static function init() { header("Content-Type:text/html;charset=utf8"); header('X-Powered-By: es 1.0'); error_reporting(E_ALL ^ E_NOTICE); date_default_timezone_set('Asia/Shanghai'); session_start(); if (empty(App::$config) && file_exists(APP_FILE . 'config.dev.php')) { App::$config = (include APP_FILE . 'config.dev.php'); } if (file_exists(APP_FILE . 'config.pro.php') && ($_dev = (include APP_FILE . 'config.pro.php'))) { APP::$config = array_merge(APP::$config, $_dev); } define('__ROOT__', str_replace($_SERVER['DOCUMENT_ROOT'], "", str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')))); }
static function init() { if (empty(APP::$config) && file_exists('./config.php')) { APP::$config = (include './config.php'); } }
public function _initConfig($config){ //设置时区 date_default_timezone_set('Etc/GMT+8'); //不进行魔术过滤 set_magic_quotes_runtime(0); //加载系统配置 require(ROOT.'/app/sys_config.php'); //加载控制器基础类 require(ROOT.'/app/control.php'); //加载数据层基础类 require(ROOT.'/app/model.php'); APP::$config = $config; }