Ejemplo n.º 1
0
function error404()
{
    //Failsafe, to prevent an infinite routing loop :)
    if (strpos($_SERVER['REQUEST_URI'], 'error') !== false) {
        //An error page 404'ed. This is bad.
        echo "Critical server error.";
        BTApp::log("Encountered error 404 while loading an error page: " . $_SERVER['REQUEST_URI'], "router", BT_SYSLOG_CRITICAL);
        BTApp::end();
    }
    //Let's just "tell" the app/router to try again - this time loading the error controller & 404 page.
    $_SERVER['REQUEST_URI'] = '/error/error404';
    BTApp::routeRequest();
    BTApp::end();
}
Ejemplo n.º 2
0
<?php

//BEGIN BALLISTIC ROUTER
try {
    define('BT_IS_ROUTED', true);
    require_once __DIR__ . '/includes/BTApp.php';
    BTApp::routeRequest();
} catch (Exception $e) {
    var_dump($e);
    echo "Core system error. Cannot continue.";
    BTApp::end();
}
//END BALLISTIC ROUTER