本文整理汇总了PHP中IEM::isCompletingUpgrade方法的典型用法代码示例。如果您正苦于以下问题:PHP IEM::isCompletingUpgrade方法的具体用法?PHP IEM::isCompletingUpgrade怎么用?PHP IEM::isCompletingUpgrade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEM
的用法示例。
在下文中一共展示了IEM::isCompletingUpgrade方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Loads the language file and checks to see if there are any upgrades. If
* there aren't any upgrades, then it redirects the user back to the admin
* index.
*
* @return UpgradNx
*/
public function __construct()
{
// if there are no upgrades, then we can't upgrade
if (!IEM::isCompletingUpgrade() && !IEM::hasUpgrade()) {
header('Location: index.php');
exit;
}
$this->LoadLanguageFile();
}
示例2: while
// If the user have not logged in yet, we need to check for "IEM_CookieLogin"
// and "IEM_LoginPreference" cookie. This cookie is used in "remember me" feature.
//
// TODO refactor this to IEM::login() function
// --------------------------------------------------------------------------------
if (!IEM::getCurrentUser()) {
$tempValid = false;
$tempCookie = false;
$tempUser = false;
// This is not a loop, rather a way to "return early" to avoid nested if
// * Comment from a later developer: If you have to do this, there is
// * probably a better way to code it. Programming doesn't necessarily
// * mean "hacking".
while (true) {
// if we are installing or upgrading then we need to bypass this
if (!IEM::isInstalled() && IEM::isInstalling() || IEM::hasUpgrade() && IEM::isUpgrading() || IEM::isCompletingUpgrade()) {
$tempValid = true;
break;
}
// Get cookie
$tempCookie = IEM::requestGetCookie('IEM_CookieLogin', array());
if (empty($tempCookie)) {
break;
}
// Check if cookie contains user information
if (!is_array($tempCookie) || !isset($tempCookie['user'])) {
break;
}
// Get user
$tempUser = new User_API();
$tempUser->Load(intval($tempCookie['user']));