本文整理匯總了PHP中Version::requires_upgrade方法的典型用法代碼示例。如果您正苦於以下問題:PHP Version::requires_upgrade方法的具體用法?PHP Version::requires_upgrade怎麽用?PHP Version::requires_upgrade使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Version
的用法示例。
在下文中一共展示了Version::requires_upgrade方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testRequires_upgrade
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());
}
示例2: InstallHandler
// 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');
/**