public function __call($name, $args) { $mark = 'invoke redis function:' . $name . ',args:' . var_export($args, true); $this->_debugger->benchmarkBegin($mark); $result = call_user_func_array(array($this->_redis, $name), $args); $this->_debugger->benchmarkEnd($mark); return $result; }
/** * @param string $statement * @param null $pdo_option * @param null $object * @return PDOStatement */ public function query($statement, $pdo_option = null, $object = null) { Debugger::getInstance()->debug('SQL:' . $statement); if ($pdo_option != null && $object != null) { $stmt = parent::query($statement, $pdo_option, $object); } else { $stmt = parent::query($statement); } if ($stmt instanceof PDOStatement) { $stmt->setFetchMode(PDO::FETCH_ASSOC); } return $stmt; }
public function execute($inputParameters = array()) { $ret = parent::execute($inputParameters); Debugger::getInstance()->debug('SQL:' . $this->queryString . ';params:' . var_export($inputParameters, true)); if (!$ret) { $error_info = parent::errorInfo(); if (parent::errorCode() != '00000') { // 执行成功时返回五个零 LoggerFactory::getLogger()->error('PDO executed failed,errors:' . var_export($error_info, true)); trigger_error($this->queryString, E_USER_ERROR); } } return $ret; }
public function prepare($query) { Debugger::getInstance()->debug('SQL:' . $query); return parent::prepare($query); }
/** * @param string $query * @return Statement */ public function prepare($query) { Debugger::getInstance()->debug('SQL:' . $query); return new Statement($this, $query); }