daux.io/libs/Config.php
Stéphane Goetz 60b50919b4 Remove "default.json" concentrate all configurations in "global.json"
Set configurations in an Object instead of an array
2015-07-20 20:49:19 +02:00

21 lines
458 B
PHP

<?php namespace Todaymade\Daux;
use ArrayObject;
class Config extends ArrayObject {
public function merge($newValues, $override = true) {
foreach ($newValues as $key => $value) {
if (array_key_exists($key, $this) && $override == false) {
continue;
}
$this[$key] = $value;
}
}
public function conservativeMerge($newValues) {
$this->merge($newValues, false);
}
}