-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapi.php
62 lines (37 loc) · 1.07 KB
/
api.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
// ===========
// API
// ===========
// Error Reportig konfigurieren
ini_set('error_reporting', -1);
ini_set('display_errors', 1);
// Zeitzone setzen
date_default_timezone_set('Europe/Berlin');
// CSV Line Ending Fix
ini_set('auto_detect_line_endings', true);
// Session starten
session_start();
// Dateien einbinden & Konfiguration laden (nur oberste Installationsebene)
require_once('constants.php');
require_once('includes.php');
require_once('configuration.php');
require_once('errorcodes.php');
// CORS
header("Access-Control-Allow-Methods: GET, POST");
header("Access-Control-Allow-Headers: X-Foo");
header("Access-Control-Max-Age: 3600");
// API Funktionen einbinden
require_once(__PATH__ . '/api-includes.php');
// API Respose Header definieren
$apiResponseHeader = array( 'error' => false,
'status' => false,
'code' => '',
'message' => '');
// API ausführen
$api->run();
// Fehler ausgeben
if(isset($_SESSION['errors'])) {
// foreach($_SESSION['errors'] as $error) { echo $error . '<br>'; }
unset($_SESSION['errors']);
}
?>