1 | <?php |
||
13 | class Options extends Dictionary { |
||
|
|||
14 | protected static $fields = null; |
||
15 | |||
16 | /** |
||
17 | * Load a PHP configuration file (script must return array) |
||
18 | * @param string $filepath The path of the PHP config file |
||
19 | * @param string $prefix_path You can insert/update the loaded array to a specific key path, if omitted it will be merged with the whole dictionary |
||
20 | */ |
||
21 | public static function loadPHP($filepath,$prefix_path=null){ |
||
27 | |||
28 | /** |
||
29 | * Load an INI configuration file |
||
30 | * @param string $filepath The path of the INI config file |
||
31 | * @param string $prefix_path You can insert/update the loaded array to a specific key path, if omitted it will be merged with the whole dictionary |
||
32 | */ |
||
33 | public static function loadINI($filepath,$prefix_path=null){ |
||
37 | |||
38 | /** |
||
39 | * Load a JSON configuration file |
||
40 | * @param string $filepath The path of the JSON config file |
||
41 | * @param string $prefix_path You can insert/update the loaded array to a specific key path, if omitted it will be merged with the whole dictionary |
||
42 | */ |
||
43 | public static function loadJSON($filepath,$prefix_path=null){ |
||
48 | |||
49 | /** |
||
50 | * Load an array to the configuration |
||
51 | * @param array $array The array to load |
||
52 | * @param string $prefix_path You can insert/update the loaded array to a specific key path, if omitted it will be merged with the whole dictionary |
||
53 | */ |
||
54 | public static function loadArray(array $array,$prefix_path=null){ |
||
63 | |||
64 | /** |
||
65 | * Load an ENV file |
||
66 | * @param string $dir The directory of the ENV file |
||
67 | * @param string $envname The filename for the ENV file (Default to `.env`) |
||
68 | * @param string $prefix_path You can insert/update the loaded array to a specific key path, if omitted it will be merged with the whole dictionary |
||
69 | */ |
||
70 | public static function loadENV($dir,$envname='.env',$prefix_path=null){ |
||
87 | |||
88 | } |
||
89 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.