public function testRequires_upgrade() { Options::set('db_version', Version::DB_VERSION - 1); $this->assertEquals(true, Version::requires_upgrade()); Options::set('db_version', Version::DB_VERSION); $this->assertEquals(false, Version::requires_upgrade()); }
// 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. // @todo Find a better place to put this. header('Content-Type: text/html;charset=utf-8'); /**