本文整理匯總了PHP中Perms::setPrefix方法的典型用法代碼示例。如果您正苦於以下問題:PHP Perms::setPrefix方法的具體用法?PHP Perms::setPrefix怎麽用?PHP Perms::setPrefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Perms
的用法示例。
在下文中一共展示了Perms::setPrefix方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getExpect
private function getExpect($categories = false, $indirectMap = array(), $globals = array())
{
$expect = new Perms();
$expect->setPrefix('tiki_p_');
$expect->setCheckSequence(array($globalAdminCheck = new Perms_Check_Alternate('admin'), $fixedResolverCheck = new Perms_Check_Fixed($globals), new Perms_Check_Direct(), new Perms_Check_Indirect($indirectMap)));
$expect->setResolverFactories(array_values(array_filter(array(new Perms_ResolverFactory_ObjectFactory(), $categories ? new Perms_ResolverFactory_CategoryFactory() : null, new Perms_ResolverFactory_GlobalFactory()))));
$resolver = $expect->getAccessor()->getResolver();
$globalAdminCheck->setResolver($resolver);
$fixedResolverCheck->setResolver($resolver);
return $expect;
}
示例2: build
function build()
{
$alternateCheck = new Perms_Check_Alternate('admin');
$fixedCheck = new Perms_Check_Fixed($this->globalOnlyPermissions);
$perms = new Perms();
$perms->setPrefix($this->prefix);
$perms->setCheckSequence($this->getSequence($alternateCheck, $fixedCheck));
$perms->setResolverFactories($this->getFactories());
$accessor = $perms->getAccessor(array());
$alternateCheck->setResolver($accessor->getResolver());
$fixedCheck->setResolver($accessor->getResolver());
return $perms;
}