1 | <?php |
||
11 | class EnvConfig implements ConfigInterface |
||
12 | { |
||
13 | /** @var string */ |
||
14 | protected $prefix; |
||
15 | |||
16 | /** |
||
17 | * EnvConfig constructor |
||
18 | * |
||
19 | * @param $prefix The string to appear before every environment |
||
20 | * variable key. For example, if the prefix is 'MYAPP_', then |
||
21 | * the key 'foo.bar' will be fetched from the environment variable |
||
22 | * MYAPP_FOO_BAR. |
||
23 | */ |
||
24 | public function __construct($prefix) |
||
30 | |||
31 | /** |
||
32 | * @inheritdoc |
||
33 | */ |
||
34 | public function has($key) |
||
38 | |||
39 | /** |
||
40 | * @inheritdoc |
||
41 | */ |
||
42 | public function get($key, $defaultFallback = null) |
||
48 | |||
49 | /** |
||
50 | * @inheritdoc |
||
51 | */ |
||
52 | public function set($key, $value) |
||
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | public function import($data) |
||
64 | |||
65 | /** |
||
66 | * @inheritdoc |
||
67 | */ |
||
68 | public function export() |
||
72 | |||
73 | /** |
||
74 | * @inheritdoc |
||
75 | */ |
||
76 | public function hasDefault($key) |
||
80 | |||
81 | /** |
||
82 | * @inheritdoc |
||
83 | */ |
||
84 | public function getDefault($key, $defaultFallback = null) |
||
88 | |||
89 | /** |
||
90 | * @inheritdoc |
||
91 | */ |
||
92 | public function setDefault($key, $value) |
||
96 | } |
||
97 |