droip.php
50 lines
| 1 | <?php |
| 2 | use TutorLMSDroip\Backend; |
| 3 | use TutorLMSDroip\Frontend; |
| 4 | use TutorLMSDroip\Helper; |
| 5 | |
| 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 7 | exit; // Exit if accessed directly. |
| 8 | } |
| 9 | |
| 10 | require_once __DIR__ . '/vendor/autoload.php'; |
| 11 | require_once __DIR__ . '../../../classes/Input.php'; // Input helper class not loaded, thats why we need to include it manually. |
| 12 | |
| 13 | /** |
| 14 | * Droip element source and filter hook will use using this prefix. |
| 15 | * this prefix value is same as javascript APP_PREFIX variable. |
| 16 | */ |
| 17 | define( 'TDE_APP_PREFIX', 'tde' ); |
| 18 | define( 'TDE_BASE', home_url() ); |
| 19 | define( 'TDE_PLUGIN_ROOT_BASE', plugin_dir_url( __FILE__ ) ); |
| 20 | |
| 21 | /** |
| 22 | * Tutor Droip Elements |
| 23 | * |
| 24 | * @package tutor-droip-elements |
| 25 | */ |
| 26 | class TutorDroipElements { |
| 27 | |
| 28 | /** |
| 29 | * Initializes a singleton instance |
| 30 | * |
| 31 | * @return \Droip |
| 32 | */ |
| 33 | public static function init() { |
| 34 | static $instance = false; |
| 35 | |
| 36 | if ( ! $instance ) { |
| 37 | $instance = new self(); |
| 38 | } |
| 39 | |
| 40 | register_activation_hook( __FILE__, array( new Helper(), 't_d_e_activate' ) ); |
| 41 | |
| 42 | new Backend(); |
| 43 | new Frontend(); |
| 44 | |
| 45 | return $instance; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | TutorDroipElements::init(); |
| 50 |