當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ModuleManager\ModuleManagerInterface類代碼示例

本文整理匯總了PHP中Zend\ModuleManager\ModuleManagerInterface的典型用法代碼示例。如果您正苦於以下問題:PHP ModuleManagerInterface類的具體用法?PHP ModuleManagerInterface怎麽用?PHP ModuleManagerInterface使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ModuleManagerInterface類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /**
  * @param  ModuleManagerInterface $moduleManager
  * @throws \Exception
  */
 public function init(ModuleManagerInterface $moduleManager)
 {
     if (PHP_SAPI === 'cli') {
         return;
     }
     $rootApplicationPath = realpath(dirname('.'));
     $userConfig = $this->getUserConfig();
     if (!isset($userConfig['maintenance']['flag_file'])) {
         throw new \Exception('The \'flag_file\' parameter is missing in config/autoload/config/autoload/maintenance{,*.}{global,local}.php');
     }
     if (file_exists($rootApplicationPath . DIRECTORY_SEPARATOR . $userConfig['maintenance']['flag_file'])) {
         if (!isset($userConfig['maintenance']['status_code']) || !isset($userConfig['maintenance']['message'])) {
             throw new \Exception('Please fill all the parameters in config/autoload/config/autoload/maintenance{,*.}{global,local}.php');
         }
         $moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULE, function (ModuleEvent $moduleEvent) {
             $moduleEvent->stopPropagation(true);
         }, PHP_INT_MAX);
         $moduleManager->getEventManager()->getSharedManager()->attach(Application::class, MvcEvent::EVENT_BOOTSTRAP, function (MvcEvent $mvcEvent) use($userConfig) {
             $response = $mvcEvent->getResponse();
             $response->setStatusCode($userConfig['maintenance']['status_code']);
             $response->setContent($this->getResponseContent());
             $mvcEvent->stopPropagation(true);
         }, PHP_INT_MAX);
     }
 }
開發者ID:mpalourdio,項目名稱:zf2-maintenance-mode,代碼行數:29,代碼來源:Module.php

示例2: init

 public function init(ModuleManagerInterface $manager)
 {
     $events = $manager->getEventManager();
     // Registering a listener at default priority, 1, which will trigger
     // after the ConfigListener merges config.
     $events->attach(ModuleEvent::EVENT_MERGE_CONFIG, array($this, 'onMergeConfig'));
 }
開發者ID:JPG-Consulting,項目名稱:LocaleManager-OLD,代碼行數:7,代碼來源:Module.php

示例3: init

 /**
  * Initialize workflow
  *
  * @param  ModuleManagerInterface $manager
  * @return void
  */
 public function init(ModuleManagerInterface $manager)
 {
     $eventManager = $manager->getEventManager();
     $eventManager->attach(ProfilerEvent::EVENT_PROFILER_INIT, function () {
         xhprof_enable(XHPROF_FLAGS_MEMORY);
     });
 }
開發者ID:skpd,項目名稱:profiler-toolbar,代碼行數:13,代碼來源:Module.php

示例4: init

 /**
  * @param ModuleManagerInterface $moduleManager
  */
 public function init(ModuleManagerInterface $moduleManager)
 {
     $moduleManager->loadModule('AssetManager');
     $sm = $moduleManager->getEvent()->getParam('ServiceManager');
     $serviceListener = $sm->get('ServiceListener');
     $serviceListener->addServiceManager('JQueryPluginManager', 'jquery_plugins', JQueryPluginProviderInterface::class, 'getJQueryPluginConfig');
 }
開發者ID:coolms,項目名稱:jquery,代碼行數:10,代碼來源:Module.php

示例5: init

 /**
  * Ensure the UI module is loaded
  *
  * @param ModuleManagerInterface $modules
  */
 public function init(ModuleManagerInterface $modules)
 {
     $loaded = $modules->getLoadedModules();
     if (isset($loaded['ZF\\Apigility\\Admin\\Ui'])) {
         return;
     }
     $modules->loadModule('ZF\\Apigility\\Admin\\Ui');
 }
開發者ID:alapini,項目名稱:apigility-3hr-tutorial,代碼行數:13,代碼來源:Module.php

示例6: init

 /**
  * Initialize module.
  *
  * If the admin UI module is not loaded yet, load it.
  *
  * Disable the opcache as well.
  *
  * @param ModuleManagerInterface $modules
  */
 public function init(ModuleManagerInterface $modules)
 {
     $loaded = $modules->getLoadedModules(false);
     if (!isset($loaded['ZF\\Apigility\\Admin\\Ui'])) {
         $modules->loadModule('ZF\\Apigility\\Admin\\Ui');
     }
     $this->disableOpCache();
 }
開發者ID:zfcampus,項目名稱:zf-apigility-admin,代碼行數:17,代碼來源:Module.php

示例7: init

 /**
  * {@inheritDoc}
  */
 public function init(ModuleManagerInterface $manager)
 {
     $events = $manager->getEventManager();
     // Initialize logger collector once the profiler is initialized itself
     $events->attach('profiler_init', function (EventInterface $e) use($manager) {
         $manager->getEvent()->getParam('ServiceManager')->get('doctrine.couch_logger_collector.odm_default');
     });
 }
開發者ID:Ellipizle,項目名稱:DoctrineCouchODMModule,代碼行數:11,代碼來源:Module.php

示例8: init

 /**
  * Initialize workflow
  *
  * @param  ModuleManagerInterface $manager
  */
 public function init(ModuleManagerInterface $manager)
 {
     if (PHP_SAPI === 'cli') {
         return;
     }
     $eventManager = $manager->getEventManager();
     $eventManager->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, array($this, 'onLoadModulesPost'), -1100);
 }
開發者ID:rafajaques,項目名稱:colloquium,代碼行數:13,代碼來源:Module.php

示例9: getModuleManager

 /**
  * @return ModuleManagerInterface
  */
 protected function getModuleManager()
 {
     if (null == $this->moduleManager) {
         $this->moduleManager = new ModuleManager([]);
         $this->moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULE_RESOLVE, new ModuleResolverListener());
     }
     return $this->moduleManager;
 }
開發者ID:mtymek,項目名稱:modular-expressive,代碼行數:11,代碼來源:ModularApplicationFactory.php

示例10: init

 /**
  * Init
  *
  * @param \Zend\ModuleManager\ModuleManagerInterface
  * @return void
  */
 public function init(ModuleManagerInterface $moduleManager)
 {
     // get the service manager
     $this->serviceLocator = $moduleManager->getEvent()->getParam('ServiceManager');
     // get the module manager
     $this->moduleManager = $moduleManager;
     $moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, [$this, 'initApplication']);
 }
開發者ID:esase,項目名稱:dream-cms,代碼行數:14,代碼來源:Module.php

示例11: init

 /**
  * @param ModuleManagerInterface $moduleManager
  */
 public function init(ModuleManagerInterface $moduleManager)
 {
     $moduleManager->loadModule('DoctrineModule');
     $moduleManager->loadModule('DoctrineORMModule');
     $moduleManager->loadModule('CmsDoctrine');
     $em = $moduleManager->getEventManager();
     $em->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, [$this, 'onPostLoadModules']);
 }
開發者ID:coolms,項目名稱:doctrine-orm,代碼行數:11,代碼來源:Module.php

示例12: init

 /**
  * {@inheritdoc}
  */
 public function init(ModuleManagerInterface $moduleManager)
 {
     /** @var ServiceManager $serviceManager */
     $serviceManager = $moduleManager->getEvent()->getParam('ServiceManager');
     /** @var ServiceListenerInterface $serviceListener */
     $serviceListener = $serviceManager->get('ServiceListener');
     $serviceListener->addServiceManager(DataMapper\Manager\DataMapperManager::class, 'thorr_persistence_dmm', DataMapper\Manager\DataMapperManagerConfigProviderInterface::class, 'getDataMapperManagerConfig');
 }
開發者ID:stefanotorresi,項目名稱:thorr-persistence,代碼行數:11,代碼來源:Module.php

示例13: init

 public function init(ModuleManagerInterface $moduleManager)
 {
     /** @var ServiceListener $serviceListener */
     $serviceListener = $moduleManager->getEvent()->getParam('ServiceManager')->get('ServiceListener');
     $serviceListener->addServiceManager(AuthorizationConditionPluginManager::class, 'zource_conditions', '', '');
     $serviceListener->addServiceManager(UiNavigationItemPluginManager::class, 'zource_ui_nav_items', '', '');
     $this->initializeErrorLogging();
 }
開發者ID:zource,項目名稱:zource,代碼行數:8,代碼來源:Module.php

示例14: init

 /**
  * Initialize workflow
  *
  * @param  ModuleManagerInterface $manager
  * @return void
  */
 public function init(ModuleManagerInterface $manager)
 {
     $this->moduleManager = $manager;
     $this->serviceLocator = $manager->getEvent()->getParam('ServiceManager');
     $shared = $manager->getEventManager()->getSharedManager();
     $shared->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array(new InjectTemplateListener(), 'injectTemplate'), -85);
     $shared->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'), 100);
 }
開發者ID:gridguyz,項目名稱:core,代碼行數:14,代碼來源:Module.php

示例15: init

 /**
  * Initialize workflow
  *
  * @param  ModuleManagerInterface $manager
  */
 public function init(ModuleManagerInterface $manager)
 {
     defined('REQUEST_MICROTIME') || define('REQUEST_MICROTIME', microtime(true));
     if (PHP_SAPI === 'cli') {
         return;
     }
     $eventManager = $manager->getEventManager();
     $eventManager->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, array($this, 'onLoadModulesPost'), -1100);
 }
開發者ID:gstearmit,項目名稱:EshopVegeTable,代碼行數:14,代碼來源:Module.php


注:本文中的Zend\ModuleManager\ModuleManagerInterface類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。