/** * @return PDOStatement */ public function execute($sql, $params = NULL, $flag = true) { if (DEBUG) { CxBug::sql($sql, $params); } $db = $this->prepare($sql); $result = is_null($params) ? $db->execute() : $db->execute($params); if (false !== $result) { return $db; } if (DEBUG) { $result = $db->errorInfo(); if (empty($result)) { $result = 'sql execute error!'; } else { $result = $result[2]; } throw new Exception($result); } }
private static function _clear() { self::$sql = null; self::$log = null; self::$start = null; self::$time = null; self::$server = null; self::$exception = null; self::$session = null; //self::$show; //self::$key; }
private function _doBug($url) { $this->controller = $url->getController(); $this->function = $url->getFunction(); if (!DEBUG) { return $this->_notfound($this->controller, $this->function); } $bug = new CxBug(); $bug->__id($this->function, $this->controller); }
/** * 向debug页面添加需要显示的变量 * @param object $k * @param object $v */ function b($k, $v = null) { CxBug::log($k, $v); }