Exemplo n.º 1
0
        define('DEBUG', false);
    }
    // The configuration file does not exist.
    // Therefore we load the installer to create the configuration file and install a base database.
    $installer = new InstallHandler();
    $installer->begin_install();
}
/* Habari is installed and we established a connection with the database */
// Set the locale from database or default locale
if (Options::get('locale')) {
    HabariLocale::set(Options::get('locale'));
} else {
    HabariLocale::set('en-us');
}
if (Options::get('system_locale')) {
    HabariLocale::set_system_locale(Options::get('system_locale'));
}
// Verify if the database has to be upgraded.
if (Version::requires_upgrade()) {
    $installer = new InstallHandler();
    $installer->upgrade_db();
}
// If we're doing unit testing, stop here
if (defined('UNIT_TEST')) {
    return;
}
// if this is an asyncronous call, ignore abort.
if (isset($_GET['asyncronous']) && Utils::crypt(Options::get('guid'), $_GET['asyncronous'])) {
    ignore_user_abort(true);
}
// Send the Content-Type HTTP header.