-
Notifications
You must be signed in to change notification settings - Fork 19
/
router.php
executable file
·36 lines (24 loc) · 943 Bytes
/
router.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
<?php
date_default_timezone_set("Europe/Berlin");
require_once(dirname(__FILE__)."/autoload.php");
require_once("php/jsonwrapper/jsonwrapper.php");
if(file_exists("connection.php")){
require("connection.php");
}
LudoDBRegistry::set('FILE_UPLOAD_PATH', '/tmp/');
LudoDBRegistry::set('DEVELOP_MODE', true);
LudoDB::enableLogging();
// For static(No db) installations
ChessRegistry::setPgnFolder("pgn");
ChessRegistry::setCacheFolder("cache"); // Path to cache
$request = isset($_GET['request']) ? $_GET['request'] : isset($_POST["request"]) ? $_POST['request'] : null;
$requestData = isset($_POST['data']) ? $_POST['data'] : null;
if(!isset($request) && isset($_POST["resource"])){
$request = $_POST["resource"];
if(isset($_POST["arguments"])){
$request.="/".$_POST["arguments"];
}
$request.="/" . $_POST["service"];
}
$handler = new LudoDBRequestHandler();
echo $handler->handle($request, $requestData);