Пример #1
0
    $opa_error_messages = array("Could not connect to database. Check your database configuration in <em>setup.php</em>.");
    require_once __CA_BASE_DIR__ . "/themes/default/views/system/configuration_error_html.php";
    exit;
}
$g_monitor = new ApplicationMonitor();
if ($g_monitor->isEnabled()) {
    $o_db->setMonitor($g_monitor);
}
//
// do a sanity check on application and server configuration before servicing a request
//
require_once __CA_APP_DIR__ . '/lib/ca/ConfigurationCheck.php';
ConfigurationCheck::performQuick();
if (ConfigurationCheck::foundErrors()) {
    if (defined('__CA_ALLOW_AUTOMATIC_UPDATE_OF_DATABASE__') && __CA_ALLOW_AUTOMATIC_UPDATE_OF_DATABASE__ && $_REQUEST['updateSchema']) {
        ConfigurationCheck::updateDatabaseSchema();
    } else {
        ConfigurationCheck::renderErrorsAsHTMLOutput();
    }
    exit;
}
// run garbage collector
GarbageCollection::gc();
$app = AppController::getInstance();
$g_request = $req = $app->getRequest();
$g_response = $resp = $app->getResponse();
// Prevent caching
$resp->addHeader("Cache-Control", "no-cache, must-revalidate");
$resp->addHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
//
// Don't try to authenticate when doing a login attempt or trying to access the 'forgot password' feature