-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
35 lines (25 loc) · 997 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
<?php
use nigiri\Psr4AutoloaderClass;
use nigiri\Site;
ini_set('display_errors', false);
ini_set('log_errors', true);
ini_set('error_log', __DIR__.'/nigiri_error.log');
require_once __DIR__.'/classes/class_loader.php';
require_once __DIR__.'/includes/functions.php';
set_error_handler('error_to_exception_handler', E_ALL);
set_exception_handler('uncaught_exception_handler');
register_shutdown_function('fatal_error_handler');
$autoloader = new Psr4AutoloaderClass();
$autoloader->register();
$autoloader->addNamespace('nigiri', __DIR__.'/classes');
$autoloader->addNamespace('site', __DIR__);
$config = require_once __DIR__.'/includes/settings.php';
$config['autoloader'] = $autoloader;
Site::init($config);
/**
* This needs to be a statement on its own. If you call it inside theme->append(), any theme change happening inside the
* controller's action won't make any real effect
*/
$output = Site::getRouter()->routeRequest();
Site::getTheme()->append($output);
Site::printPage();