public static function getView($template, $ext = '.php') { if (!is_dir(TEMPLATE_PAHT)) { longMsg('模板不存在', LONGWEIBO_ROOT); } return TEMPLATE_PATH . $template . $ext; }
public function query($sql) { $this->result = @mysql_query($sql, $this->conn); $this->queryCount++; if (!$this->result) { longMsg('sql语句执行错误:<br />' . $this->getError()); } return $this->result; }
/** * 基础方法类库 * User: zhangxy * Date: 12-9-23 * Time: 下午8:43 */ function __autoload($class) { $class = strtolower($class); if (file_exists(LONGWEIBO_ROOT . '/include/model/' . $class . '.php')) { include_once LONGWEIBO_ROOT . '/include/model/' . $class . '.php'; } elseif (file_exists(LONGWEIBO_ROOT . '/include/lib/' . $class . '.php')) { include_once LONGWEIBO_ROOT . '/include/lib/' . $class . '.php'; } elseif (file_exists(LONGWEIBO_ROOT . '/include/controller/' . $class . '.php')) { include_once LONGWEIBO_ROOT . '/include/controller/' . $class . '.php'; } else { longMsg($class . '加载失败', LONGWEIBO_ROOT); } }
private function __construct() { $this->_path = $this->setPath(); $this->rotingTable = Option::getRoutingTAble(); foreach ($this->rotingTable as $route) { $reg = $route['reg']; if (preg_match($reg, $this->_path, $matches)) { $this->_model = $route['model']; $this->_method = $route['method']; $this->_params = $matches; } } if (empty($this->_model)) { longMsg('404', LONGWEIBO_ROOT); } }