<?php
session_start();
define('IN_59MIAO', true);
//错误级别
//error_reporting(E_ALL);
error_reporting(0);
//创建一个实际路径
define('ROOT_PATH',substr(dirname(__FILE__),0,-8));
//设置编码
header('Content-Type:text/html;charset=utf-8');
//设置时区
date_default_timezone_set('Asia/Shanghai');
if(!file_exists(ROOT_PATH.'/data/install.lock')){
	header('Location: install/');	
}
//测试执行时间
//$_mtime = explode(' ',microtime());
//$_runtime=$_mtime[1] + $_mtime[0];
//define('START_TIME',$_runtime);
//前台模板配置文件
require_once 'fronttpl_config_inc.php';
//引入数据库配置文件
require ROOT_PATH.'/configs/db_config.inc.php';
//引入系统配置文件
require ROOT_PATH.'/configs/profile.inc.php';
//引入api配置文件
require ROOT_PATH.'/configs/api_config.inc.php';
//引入Smarty
require ROOT_PATH.'/public/smarty/Smarty.class.php';
require_once ROOT_PATH.'/configs/seo_rule.inc.php';

$_SERVER['REQUEST_URI']=Tool::Get_REQUEST_URI();
//自动加载类
function __autoload($_className) {
	if (substr($_className, -6) == 'Action') {
		require ROOT_PATH.'/controller/'.$_className.'.class.php';
	} elseif (substr($_className, -5) == 'Model') {
		require ROOT_PATH.'/model/'.$_className.'.class.php';
	} elseif (substr($_className, -5) == 'Check') {
		require ROOT_PATH.'/check/'.$_className.'.class.php';
	} else {
		require ROOT_PATH.'/public/'.$_className.'.class.php';
	}
}
//单入口
Factory::setAction()->run();

//$runtime=round((Factory::_runtime() - START_TIME),4);
//echo '<p style="color:red; text-align:center; height:40px; font-size:14px;">程序共执行了：'.$runtime.'秒</p>';
?>