| Conditions | 5 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 62 | public function get($config, $default = null) |
||
| 63 | { |
||
| 64 | $keys = explode('.', $config); |
||
| 65 | $filename = array_shift($keys); |
||
| 66 | $data = $this->config[$filename]; |
||
| 67 | |||
| 68 | foreach ($keys as $key) { |
||
| 69 | if (is_array($data) && array_key_exists($key, $data)) { |
||
| 70 | $data = $data[$key]; |
||
| 71 | } else { |
||
| 72 | $data = null; |
||
| 73 | } |
||
| 74 | } |
||
| 75 | |||
| 76 | if (!$data) { |
||
| 77 | $data = $default; |
||
| 78 | } |
||
| 79 | |||
| 80 | return $data; |
||
| 81 | } |
||
| 83 |