60b50919b4
Set configurations in an Object instead of an array
21 lignes
458 B
PHP
21 lignes
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);
|
|
}
|
|
}
|