API debugging wrappers
This commit is contained in:
@@ -22,20 +22,51 @@ class backend {
|
||||
|
||||
public function wrenchboard_api($in, $out = array()) {
|
||||
$this->wrenchboard_load();
|
||||
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
|
||||
if (!is_array($in)) {
|
||||
$in = array();
|
||||
}
|
||||
if (!is_array($out)) {
|
||||
$out = array();
|
||||
}
|
||||
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function logMessage($str) {
|
||||
$this->wrenchboard_load();
|
||||
if ($str == NULL || trim($str) == '') {
|
||||
return NULL;
|
||||
}
|
||||
$ret = $this->wrenchboard->logMessage($str);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function cfgReadChar($str) {
|
||||
$this->wrenchboard_load();
|
||||
$this->wrenchboard_load();
|
||||
if ($str == NULL || trim($str) == '') {
|
||||
return NULL;
|
||||
}
|
||||
$ret = $this->wrenchboard->cfgReadChar($str);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function cfgReadLong($str) {
|
||||
$this->wrenchboard_load();
|
||||
if ($str == NULL || trim($str) == '') {
|
||||
return 0;
|
||||
}
|
||||
$ret = $this->wrenchboard->cfgReadLong($str);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
private function wrenchboard_load() {
|
||||
// $this->$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $this->USER . '\\WrenchBoard';
|
||||
if (!is_object($this->wrenchboard)) {
|
||||
if (is_object($wrenchboard) && is_object($wrenchboard->wrenchboard)) {
|
||||
$this->wrenchboard = $wrenchboard->wrenchboard;
|
||||
} else if (is_object($wrenchboard)) {
|
||||
$this->wrenchboard = $wrenchboard;
|
||||
} else if (!is_object($this->wrenchboard)) {
|
||||
$this->wrenchboard = new $wrenchboard_class();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user