-
Notifications
You must be signed in to change notification settings - Fork 93
/
index.php
44 lines (38 loc) · 1.33 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
<?php
/*
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
* @license https://www.oaooa.com/licenses/
*
* @link https://www.oaooa.com
* @author zyx(zyx@oaooa.com)
*/
error_reporting(0);
define('APPTYPEID', 1);
define('CURSCRIPT', 'dzz');
define('DZZSCRIPT', basename(__FILE__));
define('BASESCRIPT', basename(__FILE__));
$routefile = 'data/cache/'. 'route.php';
$routes = require_once $routefile;
if(isset($routes['pathinfo'])){
if ((!isset($_SERVER['PATH_INFO']) || !$_SERVER['PATH_INFO'])&& isset($_SERVER['REQUEST_URI'])) {
$_SERVER['PATH_INFO'] = strstr($_SERVER['REQUEST_URI'], '?', true);
if ($_SERVER['PATH_INFO'] === false) {
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
}
}
$pathInfo = isset($_SERVER['PATH_INFO']) ? trim($_SERVER['PATH_INFO']):'';
if (strpos($pathInfo, '/') === 0) {
$pathInfo = substr($pathInfo, 1);
}
$url = array_search($pathInfo,$routes);
if($url){
$queryString = parse_url($url, PHP_URL_QUERY);
$hash = parse_url($url, PHP_URL_FRAGMENT);
parse_str($queryString, $_GET);
if ($hash) {
parse_str($hash, $hashparam);
}
$_GET['hashparams'] = json_encode($hashparam);
}
}
require __DIR__.'/core/dzzstart.php';