Esempio n. 1
0
 public function __call($func, $args)
 {
     if ($this->redis_ && method_exists($this->redis_, $func)) {
         $r = new RunTimeUtil();
         $ret = call_user_func_array(array($this->redis_, $func), $args);
         $time = $r->spent();
         Log::Info('cache', "#method:{$func}#args:" . json_encode($args) . "#ret:" . json_encode($ret) . "#runtime:{$time}");
         return $ret;
     } else {
         Log::Error('cache', "#method{$func}#args" . json_encode($args) . "#message:no funcs or client is null");
         return null;
     }
 }
Esempio n. 2
0
 public final function __call($func, $args)
 {
     if ($this->_medoo && method_exists($this->_medoo, $func)) {
         $r = new RunTimeUtil();
         $ret = call_user_func_array(array($this->_medoo, $func), $args);
         $time = $r->spent();
         $logs = $this->_medoo->log();
         Log::Info('db', "#method:{$func}#sql:" . end($logs) . "#ret:" . json_encode($ret) . "#runtime:{$time}");
         return $ret;
     } else {
         Log::Error('db', "#method{$func}#args" . json_encode($args) . "#message:no funcs or client is null");
         return null;
     }
 }