本文整理匯總了PHP中Branch::checkCurrentBranch方法的典型用法代碼示例。如果您正苦於以下問題:PHP Branch::checkCurrentBranch方法的具體用法?PHP Branch::checkCurrentBranch怎麽用?PHP Branch::checkCurrentBranch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Branch
的用法示例。
在下文中一共展示了Branch::checkCurrentBranch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getCurrentBranchId
public static function getCurrentBranchId()
{
if (!isset($_SESSION['Approved_Branch'])) {
if (!Branch::checkCurrentBranch()) {
return null;
}
}
return $_SESSION['Approved_Branch']['id'];
}
示例2: checkBranch
/**
* Returns true if the site is a hub or if the site is
* an allowed branch. If false is returned, the index file
* drops the user to an error page. Also sets the Allow_Entry GLOBAL.
*/
public static function checkBranch()
{
if (isset($GLOBALS['Allow_Entry'])) {
return $GLOBALS['Allow_Entry'];
} elseif (PHPWS_SOURCE_DIR == PHPWS_HOME_DIR) {
$GLOBALS['Allow_Entry'] = true;
return true;
} else {
if (!PHPWS_Core::initModClass('branch', 'Branch.php')) {
PHPWS_Error::log(PHPWS_HUB_IDENTITY, 'core', 'Cannot load Branch class');
return false;
}
if (Branch::checkCurrentBranch()) {
$GLOBALS['Allow_Entry'] = true;
return true;
} else {
PHPWS_Error::log(PHPWS_HUB_IDENTITY, 'core', 'Hash not found: ' . SITE_HASH . ' from ' . getcwd());
return false;
}
}
}