本文整理匯總了PHP中Zend\ModuleManager\ModuleManager::loadModule方法的典型用法代碼示例。如果您正苦於以下問題:PHP ModuleManager::loadModule方法的具體用法?PHP ModuleManager::loadModule怎麽用?PHP ModuleManager::loadModule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\ModuleManager\ModuleManager
的用法示例。
在下文中一共展示了ModuleManager::loadModule方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
/**
* @param ModuleManager $moduleManager
*/
public function init(ModuleManager $moduleManager)
{
try {
$moduleManager->loadModule('CmsAcl');
$moduleManager->loadModule('CmsRbac');
} catch (RuntimeException $e) {
}
}
示例2: init
/**
* @param ModuleManager $moduleManager
*/
public function init(ModuleManager $moduleManager)
{
$requiredModules = ['DoctrineModule', 'DoctrineORMModule', 'Thorr\\Persistence', 'Thorr\\Persistence\\Doctrine', 'Thorr\\OAuth2'];
foreach ($requiredModules as $module) {
$moduleManager->loadModule($module);
}
}
示例3: testModuleLoadingBehavior
public function testModuleLoadingBehavior()
{
$moduleManager = new ModuleManager(array('BarModule'));
$moduleManager->getEventManager()->attachAggregate($this->defaultListeners);
$modules = $moduleManager->getLoadedModules();
$this->assertSame(0, count($modules));
$modules = $moduleManager->getLoadedModules(true);
$this->assertSame(1, count($modules));
$moduleManager->loadModules();
// should not cause any problems
$moduleManager->loadModule('BarModule');
// should not cause any problems
$modules = $moduleManager->getLoadedModules(true);
// BarModule already loaded so nothing happens
$this->assertSame(1, count($modules));
}
示例4: init
public function init(ModuleManager $modules)
{
$modules->loadModule('RdnEvent');
$modules->loadModule('RdnFactory');
}
示例5: init
public function init(ModuleManager $moduleManager)
{
$moduleManager->loadModule('LoadFooModule');
}
示例6: init
/**
* @param ModuleManager $moduleManager
*/
public function init(ModuleManager $moduleManager)
{
$moduleManager->loadModule('CmsPermissions');
}
示例7: init
public function init(ModuleManager $modules)
{
$modules->loadModule('RdnConsole');
$modules->loadModule('RdnDatabase');
$modules->loadModule('RdnFactory');
}
示例8: install
/**
* Install module
*
* @param ModuleManager $moduleManager Module manager
* @param string $moduleName Module Name
*
* @return boolean|integer
*/
public static function install(ModuleManager $moduleManager, $moduleName)
{
try {
$object = $moduleManager->loadModule($moduleName);
} catch (\Exception $e) {
//Don't care
}
if (empty($object) or !$object->install()) {
return false;
}
$model = new Model();
$model->setName($moduleName);
$model->save();
$select = new Sql\Select();
$select->from('user_acl_resource')->columns(array('id'))->where->equalTo('resource', 'modules');
$insert = new Sql\Insert();
$insert->into('user_acl_permission')->values(array('permission' => $moduleName, 'user_acl_resource_id' => $model->fetchOne($select)));
$model->execute($insert);
return $model->getId();
}
示例9: init
/**
* @param ModuleManager $moduleManager
*/
public function init(ModuleManager $moduleManager)
{
$moduleManager->loadModule('CmsUser');
$moduleManager->loadModule('CmsOrg');
}