<?php
/*
 +----------------------------------------------------------------------
 | TEMMOKUMVC [ NO BEST, ONLY BETTER ]
 +----------------------------------------------------------------------
 | Copyright (c) 2018~2019 https://www.temmoku.cn All rights reserved.
 +----------------------------------------------------------------------
 | Author: 张宗强 Email:webmaster@temmoku.cn QQ:158726877 516669373 TEL:17895221001 微信:temmokumvc
 +---------------------------------------------------------------------- 
*/
// 初始化常量
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
define('APP_PATH', Temmoku_PATH.'app'.DS);
define('CONFIG', APP_PATH.'conf'.DS);
define('HOOK', APP_PATH.'hook'.DS);
define('APP_PATH_PLUG', APP_PATH.'plugin'.DS);
define('TEMPLATE', Temmoku_PATH.'view'.DS);
defined('Temmoku') or define('Temmoku', __DIR__.DS);
defined('TemmokuLib') or define('TemmokuLib', __DIR__.DS.'lib'.DS);
defined('RUNTIME_PATH') or define('RUNTIME_PATH', Temmoku_PATH.'runtime'.DS);
defined('NOWTIME') or define('NOWTIME', time());
isset($_SERVER['HTTP_REFERER']) && define('FromUrl', $_SERVER['HTTP_REFERER']);
date_default_timezone_set('Asia/Shanghai');
// 记录内存初始使用
define('MEMORY_LIMIT_ON',function_exists('memory_get_usage'));
if(MEMORY_LIMIT_ON) $GLOBALS['_startUseMems'] = memory_get_usage();
define('REQUEST_METHOD',$_SERVER['REQUEST_METHOD']);
define('IS_CGI',(0 === strpos(PHP_SAPI,'cgi') || false !== strpos(PHP_SAPI,'fcgi')) ? 1 : 0 );
define('IS_WIN',strstr(PHP_OS, 'WIN') ? 1 : 0 );
define('IS_CLI',PHP_SAPI=='cli'? 1   :   0);
//加载核心函数库
require_once Temmoku . 'functions.php';
//包含核心框架类
require_once Temmoku . 'app.php'; 
// 实例化核心类
Temmoku\app::run();
?>