<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

//define('DOMAIN','.localhost'); 
//ini_set('session.cookie_domain',DOMAIN);//跨域访问Session
// 应用入口文件

// 检测PHP环境
if (version_compare ( PHP_VERSION, '5.3.0', '<' ))
	die ( 'require PHP > 5.3.0 !' );
	
	// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
define ( 'APP_DEBUG', True );

// 定义应用目录
define ( 'APP_PATH', './Application/' );

/**
 * 缓存目录设置
 * 此目录必须可写，建议移动到非WEB目录
 */
define ( 'RUNTIME_PATH', './Runtime/' );

$session_name = session_name();
if (isset($_POST[$session_name])) {
	session_id($_POST[$session_name]);
}

$http_head='http://';
if(isset($_SERVER['HTTPS'])){
	//自动获取站点域名：apache、iis、其他
	if($_SERVER['HTTPS']===1 || $_SERVER['HTTPS']==='on' || $_SERVER['SERVER_PORT']==443){
		$http_head='https://';
	}
}
$domain=$_SERVER["SERVER_NAME"];
require './vendor/autoload.php';
if($domain==''){
	$domain=$_SERVER["SERVER_ADDR"];
}
if($_SERVER['SERVER_PORT']!=80){
	$domain=$domain.':'.$_SERVER['SERVER_PORT'];
}
define('DOMAIN_PATH',$http_head.$domain);

// 引入ThinkPHP入口文件
require './Core/ThinkPHP.php';


// 亲^_^ 后面不需要任何代码了 就是如此简单
