forked from comsince/ThinkSNS-4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.php
More file actions
36 lines (29 loc) · 1.03 KB
/
api.php
File metadata and controls
36 lines (29 loc) · 1.03 KB
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
<?php
error_reporting(E_ERROR ^ E_NOTICE ^ E_WARNING);
/* ///调试、找错时请去掉///前空格
ini_set('display_errors',true);
error_reporting(E_ALL);
set_time_limit(0);
// */
//网站根路径设置
define('SITE_PATH', dirname(__FILE__));
//默认应用设置为API
$_GET['app'] = 'api';
define('APP_NAME', 'api');
if (isset($_REQUEST['api_version'])) {
$api_version = preg_replace('/[^A-Za-z0-9\._-]/', '', $_REQUEST['api_version']);
define('API_VERSION', $api_version);
} else {
define('API_VERSION', 'sociax');
}
/* 新系统需要的一些配置 */
define('TS_ROOT', dirname(__FILE__)); // Ts根
define('TS_APPLICATION', TS_ROOT.'/apps'); // 应用存在的目录
define('TS_CONFIGURE', TS_ROOT.'/config'); // 配置文件存在的目录
define('TS_STORAGE', '/storage'); // 储存目录,需要可以公开访问,相对于域名根
define('TS_APP_DEV', false);
// 新的系统核心接入
require SITE_PATH.'/src/Build.php';
Ts::import(TS_ROOT, 'src', 'old', 'core', '.php');
Api::run();
/* # The end */