Ejemplo n.º 1
0
    }
    // if
}
// try
// Init application
if (Env::isDebugging()) {
    benchmark_timer_set_marker('Init application');
}
// if
// We need to call application.php after the routing is executed because
// some of the application classes may need CONTROLLER, ACTION or $_GET
// data collected by the matched route
require_once 'application.php';
// Set handle request timer...
if (Env::isDebugging()) {
    benchmark_timer_set_marker('Handle request');
}
// if
// Get controller and action and execute...
try {
    Env::executeAction(request_controller(), request_action());
} catch (Exception $e) {
    if (Env::isDebugging()) {
        Env::dumpError($e);
    } else {
        Logger::log($e, Logger::FATAL);
        redirect_to(get_url('error', 'execute_action'));
    }
    // if
}
// try
Ejemplo n.º 2
0
    require_once LIBRARY_PATH . '/utf8/utf8.php';
}
// Set handle request timer...
if (Env::isDebugging()) {
    benchmark_timer_set_marker('Handle request');
}
// if
$url = urldecode($_SERVER['REQUEST_URI']);
if (preg_match('/<script[^>]*>.*(<\\/script>|$)/i', $url)) {
    Logger::log("Javascript injection from " . $_SERVER['REMOTE_ADDR'] . " in URL:" . $url);
    remove_scripts_and_redirect($url);
}
// Get controller and action and execute...
try {
    if (!defined('CONSOLE_MODE')) {
        Env::executeAction(request_controller(), request_action()) or DB::rollback();
    }
} catch (Exception $e) {
    if (Env::isDebugging()) {
        Logger::log($e, Logger::FATAL);
        Env::dumpError($e);
    } else {
        Logger::log($e, Logger::FATAL);
        redirect_to(get_url('error', 'execute_action'));
    }
    // if
}
// try
if (Env::isDebuggingTime()) {
    TimeIt::stop();
    $report = TimeIt::getTimeReportByType();