Prevent blank pages on session errors #20
7
app.php
7
app.php
@ -16,16 +16,15 @@ require_once 'vendor/autoload.php';
|
|||||||
Registry::set('start', microtime(true));
|
Registry::set('start', microtime(true));
|
||||||
Registry::set('db', new Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME));
|
Registry::set('db', new Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME));
|
||||||
|
|
||||||
|
// Handle errors our own way.
|
||||||
|
ErrorHandler::enable();
|
||||||
|
|
||||||
// Do some authentication checks.
|
// Do some authentication checks.
|
||||||
Session::start();
|
Session::start();
|
||||||
$user = Authentication::isLoggedIn() ? Member::fromId($_SESSION['user_id']) : new Guest();
|
$user = Authentication::isLoggedIn() ? Member::fromId($_SESSION['user_id']) : new Guest();
|
||||||
$user->updateAccessTime();
|
$user->updateAccessTime();
|
||||||
Registry::set('user', $user);
|
Registry::set('user', $user);
|
||||||
|
|
||||||
// Handle errors our own way.
|
|
||||||
set_error_handler('ErrorHandler::handleError');
|
|
||||||
ini_set("display_errors", DEBUG ? "On" : "Off");
|
|
||||||
|
|
||||||
// The real magic starts here!
|
// The real magic starts here!
|
||||||
ob_start();
|
ob_start();
|
||||||
Dispatcher::dispatch();
|
Dispatcher::dispatch();
|
||||||
|
Loading…
Reference in New Issue
Block a user