| 1 | <?php |
||
| 8 | class ModuleLoader |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var self |
||
| 12 | */ |
||
| 13 | private static $instance; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var ModuleManifest[] Module manifests |
||
| 17 | */ |
||
| 18 | protected $manifests = array(); |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @return self |
||
| 22 | */ |
||
| 23 | public static function instance() |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Returns the currently active class manifest instance that is used for |
||
| 30 | * loading classes. |
||
| 31 | * |
||
| 32 | * @return ModuleManifest |
||
| 33 | */ |
||
| 34 | public function getManifest() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Returns true if this class loader has a manifest. |
||
| 41 | * |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | public function hasManifest() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Pushes a module manifest instance onto the top of the stack. |
||
| 51 | * |
||
| 52 | * @param ModuleManifest $manifest |
||
| 53 | */ |
||
| 54 | public function pushManifest(ModuleManifest $manifest) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return ModuleManifest |
||
| 61 | */ |
||
| 62 | public function popManifest() |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Check number of manifests |
||
| 69 | * |
||
| 70 | * @return int |
||
| 71 | */ |
||
| 72 | public function countManifests() |
||
| 76 | } |
||
| 77 |