droip.php
53 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_APP_VERSION', '1.0.2'); |
| 19 | define('TDE_BASE', home_url()); |
| 20 | define('TDE_PLUGIN_ROOT_BASE', plugin_dir_url(__FILE__)); |
| 21 | |
| 22 | /** |
| 23 | * Tutor Droip Elements |
| 24 | * |
| 25 | * @package tutor-droip-elements |
| 26 | */ |
| 27 | class TutorDroipElements |
| 28 | { |
| 29 | |
| 30 | /** |
| 31 | * Initializes a singleton instance |
| 32 | * |
| 33 | * @return \Droip |
| 34 | */ |
| 35 | public static function init() |
| 36 | { |
| 37 | static $instance = false; |
| 38 | |
| 39 | if (! $instance) { |
| 40 | $instance = new self(); |
| 41 | } |
| 42 | |
| 43 | register_activation_hook(__FILE__, [new Helper(), 't_d_e_activate']); |
| 44 | |
| 45 | new Backend(); |
| 46 | new Frontend(); |
| 47 | |
| 48 | return $instance; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | TutorDroipElements::init(); |
| 53 |