forked from Public/pics
Initial commit.
This is to be the new HashRU website based on the Aaronweb.net/Kabuki CMS.
This commit is contained in:
32
app.php
Normal file
32
app.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/*****************************************************************************
|
||||
* app.php
|
||||
* Initiates key classes and determines which controller to use.
|
||||
*
|
||||
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
|
||||
*****************************************************************************/
|
||||
|
||||
// Include the project's configuration.
|
||||
require_once 'config.php';
|
||||
|
||||
// Set up the autoloader.
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
// Initialise the database.
|
||||
Registry::set('start', microtime(true));
|
||||
Registry::set('db', new Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME));
|
||||
|
||||
// Do some authentication checks.
|
||||
Session::start();
|
||||
$user = Authentication::isLoggedIn() ? Member::fromId($_SESSION['user_id']) : new Guest();
|
||||
$user->updateAccessTime();
|
||||
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!
|
||||
ob_start();
|
||||
Dispatcher::dispatch();
|
||||
ob_end_flush();
|
||||
Reference in New Issue
Block a user