Пример #1
0
    exit;
}
require './setup.php';
define("__CA_BASE_MEMORY_USAGE__", memory_get_usage(true));
// connect to database
$o_db = new Db(null, null, false);
if (!$o_db->connected()) {
    $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;
}
//
// do a sanity check on application and server configuration before servicing a request
//
require_once __CA_APP_DIR__ . '/lib/pawtucket/ConfigurationCheck.php';
ConfigurationCheck::performQuick();
if (ConfigurationCheck::foundErrors()) {
    ConfigurationCheck::renderErrorsAsHTMLOutput();
    exit;
}
$app = AppController::getInstance();
$g_request = $app->getRequest();
$resp = $app->getResponse();
// TODO: move this into a library so $_, $g_ui_locale_id and $g_ui_locale gets set up automatically
require_once __CA_APP_DIR__ . "/helpers/initializeLocale.php";
$va_ui_locales = $g_request->config->getList('ui_locales');
if ($vs_lang = $g_request->getParameter('lang', pString)) {
    if (in_array($vs_lang, $va_ui_locales)) {
        $g_request->session->setVar('lang', $vs_lang);
    }
}