-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
30 lines (27 loc) · 881 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
define('LF',"\n");
if(isset($_SERVER['HTTP_HOST'])){
$http_host =$_SERVER['HTTP_HOST'];
if(filter_var($http_host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false){
$domain = $http_host;
}else{
$arr = explode('.',$http_host);
$c = count($arr);
$domain = $arr[$c-2].'.'.$arr[$c-1];
}
}else{
$domain = 'yz314.com';
}
define('DOMAIN',$domain);
//ob_start();
define('ENV',"dev"); //上线开关
if(ENV == "dev") define('SUFFIX',"_dev");
elseif(ENV == "test") define('SUFFIX',"_test");
else define('SUFFIX',"");
define('ROOT',__DIR__);
define('APP_DEBUG',true);
define('APP_NAME', 'Home');
define('APP_PATH',ROOT.'/Application/');
define('RUNTIME_PATH',ROOT.'/Runtime/'); //runtime目录
require ROOT.'/../ThinkPHP/vendor/autoload.php';
require ROOT.'/../ThinkPHP/ThinkPHP.php';