Dennis Brentjes
9d10d53d9f
Chunks the output buffer to 4kB chunks. This means the Download.php script will no longer run out of memory when trying to stream a tar file the output buffer.
33 lines
988 B
PHP
33 lines
988 B
PHP
<?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(null, 32768);
|
|
Dispatcher::dispatch();
|
|
ob_end_flush();
|