-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.php
More file actions
35 lines (28 loc) · 880 Bytes
/
Copy pathaction.php
File metadata and controls
35 lines (28 loc) · 880 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
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
date_default_timezone_set('UTC');
// Load the configuration
require_once(realpath(dirname(__file__)) . '/config.php');
require_once(realpath(dirname(__file__)) . '/initialise.php');
$implementsIAction = array();
foreach (get_declared_classes() as $className) {
if (in_array('IAction', class_implements($className))) {
$implementsIAction[] = $className;
}
}
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (!isset($_POST['performer']))
{
return null;
}
$performerName = $_POST['performer'];
$action = isset($_POST['action']) ? $_POST['action'] : null;
$vars = isset($_POST['vars']) ? $_POST['vars'] : null;
if (class_exists($performerName))
{
print json_encode($performerName::processAction($action, $vars));
}
}