-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.php
38 lines (27 loc) · 918 Bytes
/
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
<?php
$t = microtime(true);
// Fire up the session!
session_cache_limiter(false);
session_set_cookie_params(86400 * 7);
session_start();
setcookie(session_name(), session_id(), time() + (86400 * 7), '/', '.skillq.net', true, true);
// Autoload Slim + Twig
require( __DIR__ . "/vendor/autoload.php" );
// Load modules + database stuff (and the config)
require( "init.php" );
// initiate the timer!
$timer = new Timer();
// Start slim and load the config from the config file
$app = new \Slim\Slim($config);
// Error handling
$app->error(function (\Exception $e) use ($app){
include ( "view/error.php" );
});
// Check if the user has autologin turned on
//if(!User::isLoggedIn()) User::autoLogin();
// Load the routes - always keep at the bottom of the require list ;)
include( "routes.php" );
// Load twig stuff
include( "twig.php" );
// Run the thing!
$app->run();