1 | <?php |
||
16 | class Manager |
||
17 | { |
||
18 | /** @var array Collection of file path -> class loaded */ |
||
19 | protected static $classes = array(); |
||
20 | |||
21 | /** @var array Collection of files in current init */ |
||
22 | protected static $files = array(); |
||
23 | |||
24 | /** |
||
25 | * Load all entity configuration classes in specific location. |
||
26 | * |
||
27 | * All module files must match Entity::FILE_PATTERN to be |
||
28 | * loaded. |
||
29 | * |
||
30 | * @param string $path Path for importing classes |
||
31 | */ |
||
32 | public static function import($path) |
||
54 | |||
55 | /** @var Scheme[] Collection of available schemes */ |
||
56 | public $schemes = array(); |
||
57 | |||
58 | /** @var Scheme Pointer to current active configuration scheme */ |
||
59 | protected $active; |
||
60 | |||
61 | /** |
||
62 | * Initialize all configuration logic |
||
63 | */ |
||
64 | public function __construct() |
||
72 | |||
73 | /** |
||
74 | * Configuration class autoloader. |
||
75 | * It helps resolve single configuration entity configuration dependencies |
||
76 | * @param string $className Class name for loading |
||
77 | */ |
||
78 | public function autoload($className) |
||
89 | |||
90 | /** |
||
91 | * Switch active environment |
||
92 | * @param string $environment Configuration environment identifier |
||
93 | */ |
||
94 | public function change($environment = Scheme::BASE) |
||
117 | |||
118 | /** |
||
119 | * Initialize all configuration logic |
||
120 | * @param string $basePath Path to configuration base folder |
||
121 | */ |
||
122 | public function init($basePath) |
||
136 | |||
137 | /** |
||
138 | * Create configuration scheme |
||
139 | * @param string $path Path to configuration scheme folder |
||
140 | * @param string $environment Configuration scheme environment identifier |
||
141 | */ |
||
142 | public function create($path, $environment = null) |
||
160 | |||
161 | /** |
||
162 | * Configure object with current configuration scheme entity parameters. |
||
163 | * |
||
164 | * If now $identifier is passed - automatic identifier generation |
||
165 | * will take place from object class name. |
||
166 | * |
||
167 | * If additional parameters key=>value collection is passed, they |
||
168 | * will be used to configure object instead of entity configuration |
||
169 | * class. |
||
170 | * |
||
171 | * If current configuration scheme has no entity configuration for |
||
172 | * passed object - global configuration scheme will be used. |
||
173 | * |
||
174 | * @param mixed $object Object for configuration with entity |
||
175 | * @param string $identifier Configuration entity name |
||
176 | * @param array|null $params Collection of configuration parameters |
||
177 | */ |
||
178 | public function configure(& $object, $identifier = null, $params = null) |
||
190 | } |
||
191 |