本文整理汇总了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');
/**