forked from thinksaas/ThinkSAAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
55 lines (51 loc) · 1.68 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* ThinkSAAS开源社区
* copyright (c) 2010-3000 ThinkSAAS All Rights Reserved
* 官网:https://www.thinksaas.cn
* 作者:邱君
* Email:[email protected]
* QQ:1078700473
* 微信:thinksaas
*/
define('IN_TS', true);
header('Content-Type: text/html; charset=UTF-8');
#php版本限制
if (substr(PHP_VERSION, 0, 3)<5.5) {
exit("ThinkSAAS运行环境要求PHP5.5或者更高!");
}
#定义一些路径
define('THINKROOT', dirname(__FILE__));
define('THINKAPP', THINKROOT . '/app');
define('THINKDATA', THINKROOT . '/data');
define('THINKSAAS', THINKROOT . '/thinksaas');
define('THINKINSTALL', THINKROOT . '/install');
define('THINKPLUGIN', THINKROOT . '/plugins');
#核心配置文件 $TS_CF 系统配置变量
$TS_CF = include THINKROOT . '/thinksaas/config.php';
$TS_CF['info']['version'] = include 'upgrade/version.php';#版本信息
#如果是调试模式,打开警告输出
if ($TS_CF['debug']) {
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
} else {
error_reporting(0);
}
#php环境的某一些配置
//ini_set("memory_limit","120M");
ini_set('display_errors', 'on'); //正式环境关闭错误输出
set_time_limit(0);
ini_set('session.cookie_path', '/');
//自定义本地session存储目录路径
if ($TS_CF['sessionpath']) {
ini_set('session.save_path', THINKROOT . '\\cache\\sessions');
}
if($TS_CF['session']=='redis'){
ini_set("session.save_handler","redis");
ini_set("session.save_path",$TS_CF['redis']['tcp']);
}
session_start();
#自动加载所需功能,支持composer
require_once THINKROOT . '/vendor/autoload.php';
#装载ThinkSAAS核心
include THINKSAAS.'/thinksaas.php';
unset($GLOBALS);