public function __call($name, $args) { if (!in_array($name, array('execute', 'select'))) { return call_user_func_array(array($this->_rdb, $name), $args); } Pluf_Log::stime('timer'); $res = call_user_func_array(array($this->_rdb, $name), $args); Pluf_Log::perf(array('Pluf_DB_Stats', $this->_rdb->lastquery, Pluf_Log::etime('timer', 'total_sql'))); Pluf_Log::inc('sql_query'); return $res; }
/** * Run shell_exec and log some information. * * @param $caller Calling method * @param $cmd Command to run * @return string The output */ public static function shell_exec($caller, $cmd) { Pluf_Log::stime('timer'); $ret = shell_exec($cmd); Pluf_Log::perf(array($caller, $cmd, Pluf_Log::etime('timer', 'total_exec'))); Pluf_Log::debug(array($caller, $cmd, $ret)); Pluf_Log::inc('exec_calls'); return $ret; }