Add appendConf
This commit is contained in:
17
cmpUtil.php
17
cmpUtil.php
@@ -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"] . "'");
|
||||||
|
Reference in New Issue
Block a user