Abstract_Plugin_Register.php
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Base Plugin register |
| 5 | * |
| 6 | * Register all plugins to Dependency Class |
| 7 | * |
| 8 | * @package Tribe |
| 9 | * @since 4.9 |
| 10 | * |
| 11 | */ |
| 12 | abstract class Tribe__Abstract_Plugin_Register { |
| 13 | |
| 14 | /** |
| 15 | * The absolute path to the plugin file, the one that contains the plugin header. |
| 16 | * |
| 17 | * @var string |
| 18 | */ |
| 19 | protected $base_dir; |
| 20 | |
| 21 | /** |
| 22 | * @var string |
| 23 | */ |
| 24 | protected $main_class; |
| 25 | |
| 26 | /** |
| 27 | * @var string |
| 28 | */ |
| 29 | protected $version; |
| 30 | |
| 31 | /** |
| 32 | * @since 4.9.17 |
| 33 | * |
| 34 | * @var array |
| 35 | */ |
| 36 | protected $classes_req = []; |
| 37 | |
| 38 | /** |
| 39 | * @var array |
| 40 | */ |
| 41 | protected $dependencies = [ |
| 42 | 'parent-dependencies' => [], |
| 43 | 'co-dependencies' => [], |
| 44 | 'addon-dependencies' => [], |
| 45 | ]; |
| 46 | |
| 47 | /** |
| 48 | * Registers a plugin with dependencies |
| 49 | */ |
| 50 | public function register_plugin() { |
| 51 | tribe_register_plugin( |
| 52 | $this->base_dir, |
| 53 | $this->main_class, |
| 54 | $this->version, |
| 55 | $this->classes_req, |
| 56 | $this->dependencies |
| 57 | ); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Returns whether or not the dependencies have been met |
| 62 | * |
| 63 | * This is basically an aliased function - register_plugins, upon |
| 64 | * second calling, returns whether or not a plugin should load. |
| 65 | * |
| 66 | * @deprecated since 4.9.17 It is unused by any Tribe plugins and returned void. |
| 67 | * @todo remove in 4.11 |
| 68 | */ |
| 69 | public function has_valid_dependencies() { |
| 70 | _deprecated_function( __METHOD__, '4.9.17' ); |
| 71 | } |
| 72 | } |