forked from GeekZooStudio/ECMobile_Universal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·87 lines (63 loc) · 2.14 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
error_reporting(E_ALL);
define('GZ_PATH', dirname(__FILE__));
define('EC_PATH', dirname(GZ_PATH));
// define('INIT_NO_SMARTY', true);
require GZ_PATH.'/library/function.php';
spl_autoload_register('gz_autoload');
GZ_Api::init();
$url = _GET('url');
$controller = 'index';
$tmp = $url ? array_filter(explode('/', $url)) : array();
$path = GZ_PATH . '/controller';
$payment = _GET('payment');
if ($payment)
{
$path = GZ_PATH . '/payment';
$tmp = $payment ? array_filter(explode('/', $payment)) : array();
}
$tmp = array_values($tmp);
//reset($tmp);
$count = count($tmp);
for ($i = 0; $i < $count; $i++) {
if (!is_dir($path.'/'.$tmp[$i])) {
break;
}
$path .= '/'.$tmp[$i];
}
if (isset($tmp[$i])) {
$controller = $tmp[$i];
$i++;
}
$file = $path.'/'.$controller.'.php';
$i && $tmp = array_slice($tmp, $i);
if (file_exists($file)) {
define('IN_ECS', true);
require $file;
} else {
echo <<< ___END___
<!DOCTYPE html>
<html class="no-js">
<head>
<title>ECMobile</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body style="padding: 10px;">
<!--[if lt IE 8]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<p style="font-size: 14px;">感谢使用ECMobile产品</p>
<p style="font-size: 14px;">官方论坛:<a href="http://bbs.ecmobile.cn/">http://bbs.ecmobile.cn/</a></p>
<p style="font-size: 14px;">QQ群1:329673575</p>
<p style="font-size: 14px;">QQ群2:239571314</p>
<p style="font-size: 14px;">QQ群3:347624547</p>
<br/>
<p style="font-size: 14px;">接下来,您可以:</p>
<p style="font-size: 14px;">API测试:<a target="_blank" href="./test">点击这里</a></p>
<p style="font-size: 14px;">API文档:<a target="_blank" href="./test/ecmobile.json">点击这里</a></p>
</body>
</html>
___END___;
}