Add appendConf

This commit is contained in:
cmp167
2023-03-28 04:21:20 +12:00
parent 4f6a0b17ed
commit 8329ec125b

View File

@@ -160,16 +160,25 @@
return $obj; return $obj;
} }
function appendConf($arr) {
if(!$arr)
return false;
foreach($arr as $k => $v) {
// $this->d("Set parm .$k to $v");
$this->parm[$k] = $v;
}
return true;
}
function readJSONConf($file) { function readJSONConf($file) {
$obj = $this->readJSON($file); $obj = $this->readJSON($file);
if(!$obj) if(!$obj)
return false; return false;
foreach($obj as $k => $v) { $this->appendConf($obj);
// $this->d("Set parm .$k to $v");
$this->parm[$k] = $v;
}
if(@$this->parm["timezone"]) { if(@$this->parm["timezone"]) {
$this->d("Set timezone '" . $this->parm["timezone"] . "'"); $this->d("Set timezone '" . $this->parm["timezone"] . "'");