<?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;

error_reporting(E_ALL ^ E_NOTICE);

//header("Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'");

define('__ROOT_DIR__',str_replace("\\",'/',realpath(dirname(__FILE__).'/../')));
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
define("PUBLIC_PATH", __DIR__ . DIRECTORY_SEPARATOR);
define("ADDON_PATH", ROOT_PATH . 'app' . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR);

require __DIR__ . '/../vendor/autoload.php';
if (is_file(ROOT_PATH . 'extend/360_safe/WebScan.php')) {
    include_once(ROOT_PATH . 'extend/360_safe/WebScan.php');
}
// 执行HTTP应用并响应
$http = (new App())->http;

// $path = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$path = isset($_GET['s']) ? $_GET['s'] : '';
// $path = '/' . $path;
// $path = $path;
// dump($_GET, stripos($path, '@growthman1688'));
if (stripos($path, '@growthman1688') == 1 || stripos($path, 'captcha') == 1 || stripos($path, 'addons') == 1) {
// dump(1);
    $response = $http->run();
} else {
// dump(2);
    $response = $http->name('cms')->run();
}
//$response = $http->run();

$response->send();

$http->end($response);
