64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* index.php
|
|
*
|
|
* All application traffic should be directed to/through this file.
|
|
* It mostly handles some last minute routing and initializes the app.
|
|
*
|
|
* @version 3.0
|
|
* @author Joey Kimsey <Joey@thetempusproject.com>
|
|
* @link https://TheTempusProject.com
|
|
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
|
*/
|
|
namespace TheTempusProject;
|
|
|
|
session_start();
|
|
|
|
require_once 'bin/autoload.php';
|
|
|
|
use TheTempusProject\Canary\Bin\Canary as Debug;
|
|
use TheTempusProject\Bedrock\Functions\Input;
|
|
use TheTempusProject\Hermes\Functions\Redirect;
|
|
use TheTempusProject\Hermes\Functions\Route;
|
|
use TheTempusProject\Houdini\Classes\Components;
|
|
use TheTempusProject\Houdini\Classes\Views;
|
|
|
|
/**
|
|
* Instantiate a new instance of our application.
|
|
*
|
|
* You can add to the conditional for any pages that you want to have
|
|
* access to outside of the typical .htaccess redirect methods.
|
|
*/
|
|
$url = '';
|
|
|
|
$app = new TheTempusProject();
|
|
|
|
if ( Input::exists( 'error' ) ) {
|
|
switch ( Input::get( 'error' ) ) {
|
|
case 'image404':
|
|
Redirect::to( 'images/imageNotFound.png' );
|
|
exit;
|
|
default:
|
|
$app->setUrl( 'error/' . Input::get( 'error' ) );
|
|
break;
|
|
}
|
|
} elseif ( stripos( Route::getUri(), 'install.php' ) ) {
|
|
require_once 'install.php';
|
|
}
|
|
|
|
if ( CANARY_ENABLED ) {
|
|
ini_set( 'display_errors', '1' );
|
|
ini_set( 'display_startup_errors', '1' );
|
|
error_reporting( E_ALL );
|
|
// $app->printDebug();
|
|
}
|
|
|
|
$app->load();
|
|
|
|
if ( CANARY_DEBUG_TO_CONSOLE ) {
|
|
Components::set( 'DEBUGGING_LOG', Debug::dump() );
|
|
register_shutdown_function( [ $app::class, 'handle_shutdown' ] );
|
|
}
|
|
|
|
Debug::gend();
|