<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]
// [ PHP版本检查 ]

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Credentials: true'); // 设置是否允许发送 cookies
header('Access-Control-Expose-Headers: *');  //服务器 headers 白名单，可以让客户端进行访问
header('Access-Control-Allow-Headers: *');
header("Content-type: text/html; charset=utf-8");
if (version_compare(PHP_VERSION, '7.0.0', '<')) {
    die('PHP版本过低，最少需要PHP5.5，请升级PHP版本！');
}
define('APP_SOCKET', __DIR__ . '/../socket/');

define('APP_PATH', __DIR__ . '/../application/');
//
//// 定义资源目录
//define('PUBLIC_PATH', __DIR__ . '/');
//
////主题目录
//define('THEME_PATH', __DIR__ . '/themes/');
// 检测是否安装
/**
 * 定义标记
 */


// 判断是否安装
if (!is_file(APP_PATH . 'install.lock')) {
    // 加载框架引导文件
    require __DIR__ . '/../thinkphp/base.php';

// 绑定到admin模块
    \think\Route::bind('install');

// 关闭路由
    \think\App::route(false);

// 设置根url
    \think\Url::root('');

// 执行应用
    \think\App::run()->send();


}else{
    require __DIR__ . '/../thinkphp/start.php';
}

// 加载框架引导文件

// // 读取自动生成定义文件
// $build = include __DIR__ .'/build.php';
// // 运行自动生成
// \think\Build::run($build);