USER = $_SERVER['SCRIPT_FILENAME']; $this->USER = str_replace('/home', '', $this->USER); $this->USER = strtok($this->USER, '/'); if ($this->USER == 'opt') { $this->USER = 'root'; } $this->thisUser = $this->USER; } public function jubabox_api($in, &$out) { if (!is_array($out)) return -1; $this->jubabox_load(); $rrr = array(); $jubabox = $this->jubabox; $ret = $jubabox->jubabox_api($in, $rrr); //print_r( $in ); //echo "-----\n"; //print_r( $rrr ); $out = $rrr; return $ret; } public function cfgReadChar($str) { $this->jubabox_load(); $ret = $this->jubabox->cfgReadChar($str); return $ret; } private function jubabox_load() { // $this->$USER = $_SERVER['SCRIPT_FILENAME']; $jubabox_class = 'jubabox_api_' . $this->USER . '\\jubabox'; if (!is_object($this->jubabox)) { $this->jubabox = new $jubabox_class(); } } }