1 | <?php |
||
10 | class ConfigLoader |
||
11 | { |
||
12 | /** |
||
13 | * @internal |
||
14 | * @var self |
||
15 | */ |
||
16 | private static $instance; |
||
17 | |||
18 | /** |
||
19 | * @var ConfigCollectionInterface[] map of config collections |
||
20 | */ |
||
21 | protected $manifests = array(); |
||
22 | |||
23 | /** |
||
24 | * @return self |
||
25 | */ |
||
26 | public static function inst() |
||
27 | { |
||
28 | return self::$instance ? self::$instance : self::$instance = new self(); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Returns the currently active class manifest instance that is used for |
||
33 | * loading classes. |
||
34 | * |
||
35 | * @return ConfigCollectionInterface |
||
36 | */ |
||
37 | public function getManifest() |
||
41 | |||
42 | /** |
||
43 | * Returns true if this class loader has a manifest. |
||
44 | * |
||
45 | * @return bool |
||
46 | */ |
||
47 | public function hasManifest() |
||
51 | |||
52 | /** |
||
53 | * Pushes a class manifest instance onto the top of the stack. |
||
54 | * |
||
55 | * @param ConfigCollectionInterface $manifest |
||
56 | */ |
||
57 | public function pushManifest(ConfigCollectionInterface $manifest) |
||
61 | |||
62 | /** |
||
63 | * @return ConfigCollectionInterface |
||
64 | */ |
||
65 | public function popManifest() |
||
69 | |||
70 | /** |
||
71 | * Check number of manifests |
||
72 | * |
||
73 | * @return int |
||
74 | */ |
||
75 | public function countManifests() |
||
79 | |||
80 | /** |
||
81 | * Nest the current manifest |
||
82 | * |
||
83 | * @return ConfigCollectionInterface |
||
84 | */ |
||
85 | public function nest() |
||
91 | } |
||
92 |