30 lines
745 B
PHP
30 lines
745 B
PHP
<?php
|
|
|
|
require("vendor/autoload.php");
|
|
require("utilities/transform.php");
|
|
|
|
// ---------------------------------------------------------------------------------
|
|
|
|
$aura_loader = new \Aura\Autoload\Loader;
|
|
$aura_loader->addPrefix('Sandpiper', '.');
|
|
$aura_loader->addPrefix('SBRL\Utilities', './utilities');
|
|
$aura_loader->register();
|
|
|
|
// ---------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
function send_error($code, $message) {
|
|
http_response_code($code);
|
|
header("content-type: text/plain");
|
|
exit("$message\n");
|
|
}
|
|
|
|
if(empty($_GET["action"]))
|
|
send_error(400, "No action specified.");
|
|
|
|
$action = $_GET["action"];
|
|
|
|
$handler_name = "Sandpiper\\Actions\\$action";
|
|
$handler = new $handler_name();
|
|
$handler->handle();
|