flush
[pharext/pharext.org] / app / Config.php
1 <?php
2
3 namespace app;
4
5 use merry\Config as Container;
6
7 class Config extends Container
8 {
9 function addConfig(Config $config) {
10 foreach ($config as $sub => $conf) {
11 /* one level down should suffice, i.e. $config->github->client = {id,secret,scope} */
12 if ($conf instanceof Config) {
13 foreach ($conf as $key => $val) {
14 $this->$sub->$key = $val;
15 }
16 } else {
17 $this->$sub = $conf;
18 }
19 }
20 }
21 }