1 | <?php |
||
7 | class Config |
||
8 | { |
||
9 | /** |
||
10 | * Loaded Configuration Items |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $configuration = []; |
||
15 | |||
16 | /** |
||
17 | * Path to Configuration Folder |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $path; |
||
22 | |||
23 | /** |
||
24 | * Configuration file extension |
||
25 | */ |
||
26 | const CONFIG_FILE_EXTENSION = ".php"; |
||
27 | |||
28 | /** |
||
29 | * Config constructor. |
||
30 | * |
||
31 | * @param $configFolderPath |
||
32 | */ |
||
33 | 2 | public function __construct($configFolderPath) |
|
37 | |||
38 | /** |
||
39 | * Sets the configuration folder path |
||
40 | * |
||
41 | * @param $path |
||
42 | */ |
||
43 | 2 | protected function setPath($path) |
|
47 | |||
48 | /** |
||
49 | * Loads a configuration file in to memory |
||
50 | * |
||
51 | * @param $key |
||
52 | * |
||
53 | * @throws ConfigException |
||
54 | */ |
||
55 | 2 | protected function loadConfigFile($key) |
|
66 | |||
67 | /** |
||
68 | * Get Configuration Item |
||
69 | * |
||
70 | * @param $key |
||
71 | * |
||
72 | * @return mixed |
||
73 | */ |
||
74 | 2 | public function get($key) |
|
82 | } |