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

// [ 应用入口文件 ]
namespace think;

require __DIR__ . '/../vendor/autoload.php';

// 执行HTTP应用并响应
$http = (new App())->http;
$data = [
    'domain_url'=>['scrm.com','api.scrm.com'],
    'api_domain_url'=>['scrm.com','api.scrm.com'],
    'from'=>'vlcms',
    'multi_corp'=>'0',//1支持多企业 0不支持
    'version'=>'1',//0运营版  1源码版
];
$from = require($_SERVER['DOCUMENT_ROOT'].'/'.'static'.'/'.'from'.'.'.'php');
if($data!=$from){
//    exit('validation file mismatch 1');
}
if(!empty($_SERVER['SERVER_NAME'])) {
    if (!in_array($_SERVER['SERVER_NAME'], $from['domain_url'])
        || !in_array($_SERVER['SERVER_NAME'], $from['api_domain_url'])) {
//        exit('ip or domain is not on the white list 1');
    }
}
$response = $http->run();

$response->send();

$http->end($response);
