-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
52 lines (37 loc) · 1.19 KB
/
index.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
<?php
if (PHP_SAPI == 'cli-server') {
// To help the built-in PHP dev server, check if the request was actually for
// something which should probably be served as a static file
$file = __DIR__ . $_SERVER['REQUEST_URI'];
if (is_file($file)) {
return false;
}
}
require __DIR__ . '/vendor/autoload.php';
error_reporting(E_ALL);
ini_set("display_errors", "On");
ini_set("display_startup_errors", "On");
date_default_timezone_set("Europe/London");
session_start();
// TODO: setup the production domain
$stagingDomain = 'playground.mattimatti.com';
$isStaging = (strpos($_SERVER['HTTP_HOST'], $stagingDomain) !== false);
if ($isStaging) {
$settings = require __DIR__ . '/src/staging.php';
} else {
$settings = require __DIR__ . '/src/production.php';
}
// Instantiate the app
// print_r($settings);
// exit();
// set this header for facebook cookie saving.
header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
$app = new \Slim\App($settings);
// Set up dependencies
require __DIR__ . '/src/dependencies.php';
// Register middleware
require __DIR__ . '/src/middleware.php';
// Register routes
require __DIR__ . '/src/routes.php';
// Run app
$app->run();