Beispiel #1
0
 /**
  * 运行项目
  */
 public static function run()
 {
     self::init();
     //初始化运行环境
     self::formatRequest();
     //如果开启自动转义,去除转义
     self::setAppGroupPath();
     //设置应用路径
     self::loadAppGroupConfig();
     //载入应用组配置
     self::setAppPath();
     //设置PATH_APP
     self::loadAppConfig();
     //加载应用配置文件
     self::loadUserFile();
     //加载系统类文件数据
     self::setPathConst();
     //设置缓存目录常量
     self::createDemoControl();
     //创建应用目录
     self::setTplConst();
     //设置模板常量
     self::language();
     //加载语言包
     self::ajaxCloseDebug();
     //ajax时关闭调试
     self::setCharset();
     //设置字符集
     self::createDir();
     //创建项目缓存目录结构
     self::session_set();
     self::compileAppGroupFile();
     //项目核心文件编译缓存
     self::compileAppFile();
     //模块核心文件编译缓存
     debug::start("app_start");
     //调试开启,需要打开配置文件调试开关
     self::apprun();
     //项目开始
     debug::show("app_start", "app_end");
     //显示调试结果
     log::save();
     //记录日志
 }
 /**
  * 连贯操作执行的find查询操作
  * @param string $field
  */
 public function count()
 {
     $this->initSql();
     $sql = "SELECT count(*) as count FROM {$this->pre}{$this->table}  {$this->sql['where']} {$this->sql['group']} {$this->sql['having']} {$this->sql['order']} {$this->sql['limit']}";
     $this->check_query($sql);
     debug::start();
     $re = $this->_execute('fetch_first', $sql);
     debug::end();
     debug::add("{$sql}  [" . debug::spent() . "]", 1);
     if (!empty($re)) {
         return $re['count'];
     }
     return $re;
 }
 /**
  * Add a timer entry. Query timer entries are not processed if self::$timeQueries is false
  * @param String $title title of the entry
  * @param Boolean $query[optional] process (or not) $query entries - default: false
  * @return void
  */
 public static function timer($title, $query = false)
 {
     if ($query && !self::$timeQueries) {
         return;
     }
     $time = explode(" ", microtime());
     $time = $time[1] + $time[0];
     if (self::$start == 0) {
         self::$start = $time;
     }
     if (PAGE_LOADER) {
         self::$timer[] = array('title' => $title, 'time' => $time - self::$start);
     }
 }
Beispiel #4
0
<?php

include "config.php";
include SYS_ROOT . "utils/global.php";
/*
if ($_SERVER['REQUEST_URI'] == '/feeds/main/' || $_SERVER['REQUEST_URI'] == '/feeds/main')
{
	headers::url('/feed/articles/');
	exit;
}
*/
debug::start();
router::start();
debug::stop();