1 | <?php |
||
22 | class ConfigLoader |
||
23 | { |
||
24 | /** |
||
25 | * @var array configuration data |
||
26 | */ |
||
27 | protected $config; |
||
28 | |||
29 | /** |
||
30 | * @var string path to configuration files |
||
31 | */ |
||
32 | protected $path; |
||
33 | |||
34 | /** |
||
35 | * @var string environment |
||
36 | */ |
||
37 | protected $environment; |
||
38 | |||
39 | /** |
||
40 | * @return array |
||
41 | */ |
||
42 | 604 | public function getConfig() : array |
|
46 | |||
47 | /** |
||
48 | * @return string |
||
49 | */ |
||
50 | public function getPath() : string |
||
54 | |||
55 | /** |
||
56 | * Set path to configuration files |
||
57 | * |
||
58 | * @param string $path |
||
59 | * |
||
60 | * @return void |
||
61 | * @throws ConfigException |
||
62 | */ |
||
63 | 606 | public function setPath($path) : void |
|
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | public function getEnvironment() : string |
||
78 | |||
79 | /** |
||
80 | * Set application environment |
||
81 | * |
||
82 | * @param string $environment |
||
83 | * |
||
84 | * @return void |
||
85 | */ |
||
86 | 604 | public function setEnvironment($environment) : void |
|
90 | |||
91 | /** |
||
92 | * Load configuration |
||
93 | * |
||
94 | * @return void |
||
95 | * @throws ConfigException |
||
96 | */ |
||
97 | 608 | public function load() : void |
|
110 | |||
111 | /** |
||
112 | * Load configuration file |
||
113 | * |
||
114 | * @param string $path |
||
115 | * |
||
116 | * @return mixed |
||
117 | * @throws ConfigException |
||
118 | */ |
||
119 | 604 | protected function loadFile($path) |
|
126 | |||
127 | /** |
||
128 | * Load configuration files to array |
||
129 | * |
||
130 | * @param string $path |
||
131 | * |
||
132 | * @return array |
||
133 | * @throws ConfigException |
||
134 | */ |
||
135 | 604 | protected function loadFiles($path) : array |
|
154 | } |
||
155 |