1 | <?php /** MicroContainer */ |
||
17 | class Container extends \stdClass implements IContainer |
||
18 | { |
||
19 | /** @var array $data data */ |
||
20 | protected $data = []; |
||
21 | /** @var array $config Configs */ |
||
22 | protected $config = []; |
||
23 | /** @var array $components Components config */ |
||
24 | protected $components = []; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Load more configs from file |
||
29 | * |
||
30 | * @access public |
||
31 | * |
||
32 | * @param string $filename |
||
33 | * |
||
34 | * @return void |
||
35 | */ |
||
36 | public function load($filename) |
||
45 | |||
46 | /** |
||
47 | * Is set component or option name into Container |
||
48 | * |
||
49 | * @access public |
||
50 | * |
||
51 | * @param string $name Name attribute |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | public function __isset($name) |
||
69 | |||
70 | /** |
||
71 | * Get Container value |
||
72 | * |
||
73 | * @access public |
||
74 | * |
||
75 | * @param string $name element name |
||
76 | * |
||
77 | * @return mixed |
||
78 | */ |
||
79 | public function __get($name = '') |
||
91 | |||
92 | /** |
||
93 | * Set attribute |
||
94 | * |
||
95 | * @access public |
||
96 | * |
||
97 | * @param string $name Name attribute |
||
98 | * @param mixed $component Component or option |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | public function __set($name, $component) |
||
106 | |||
107 | /** |
||
108 | * Get component's |
||
109 | * |
||
110 | * @access public |
||
111 | * |
||
112 | * @param string|null $name name element to initialize |
||
113 | * |
||
114 | * @return bool |
||
115 | */ |
||
116 | public function configure($name = null) |
||
142 | |||
143 | /** |
||
144 | * Load component |
||
145 | * |
||
146 | * @access public |
||
147 | * |
||
148 | * @param string $name component name |
||
149 | * @param array $options component configs |
||
150 | * |
||
151 | * @return bool |
||
152 | */ |
||
153 | public function loadComponent($name, $options) |
||
183 | } |
||
184 |