-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapi.php
More file actions
executable file
·35 lines (35 loc) · 928 Bytes
/
api.php
File metadata and controls
executable file
·35 lines (35 loc) · 928 Bytes
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
<?php
/**
* api的接口请求访问:http://我的域名/api.php/index/test
*/
include_once('config/config.php');
$_paths = '';
$d = 'task';$m = 'index';$a = 'index';
if(isset($_GET['m'])){
$m = $rock->get('m');
$a = $rock->get('a', $a);
}else{
if(isset($_SERVER['PHP_SELF']))$_paths=$_SERVER['PHP_SELF'];
if($_paths==''&&isset($_SERVER['ORIG_PATH_INFO']))$_paths=$_SERVER['ORIG_PATH_INFO'];
$_patha = explode('api.php', $_paths);
$_paths = '/index/index';
if(isset($_patha[1])){
$_paths = $_patha[1];
}else{
if(isset($_SERVER['PATH_INFO']))$_paths=$_SERVER['PATH_INFO'];
}
}
unset($_GET['d']);
unset($_GET['m']);
unset($_GET['a']);
if($_paths){
$_pa = explode('/', $_paths);
if(isset($_pa[1])&&$_pa[1])$m=$_pa[1];
if(isset($_pa[2])&&$_pa[2])$a=$_pa[2];
}
if(substr($m,0,4)=='open'){
$m = ''.$m.'|openapi';
}else{
$m = ''.$m.'|api';
}
include_once('include/View.php');