-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
48 lines (27 loc) · 675 Bytes
/
index.php
File metadata and controls
48 lines (27 loc) · 675 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
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
require_once('constants.php');
header('Content-Type: ' . TYPE_JSON);
function setError($text) {
$json = array('error' => $text);
echo json_encode($json);
}
if (count($_REQUEST) > 0) {
foreach ($_REQUEST as $key => $param) {
if ($key != null) {
list($apiClass, $apiFunc) = explode("_", $key);
unset($_REQUEST[$key]);
require_once('engine.php');
$APIEngine = new APIEngine($apiClass, $apiFunc, $_REQUEST);
echo $APIEngine -> callApiFunction();
} else {
setError(BADMETHOD);
}
break;
}
} else {
setError(NOFUNC);
}
?>