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


PHP ModuleManager\ModuleManager類代碼示例

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


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

示例1: init

 /**
  * Wird bei der Initialisierung des Moduls aufgerufen
  * @param \Zend\ModuleManager\ModuleManager $moduleManager
  */
 public function init(\Zend\ModuleManager\ModuleManager $moduleManager)
 {
     $sharedManager = $moduleManager->getEventManager()->getSharedManager();
     $sharedManager->attach('DragonJsonServer\\Service\\Server', 'Request', function (\DragonJsonServer\Event\Request $eventRequest) {
         $request = $eventRequest->getRequest();
         $method = $request->getMethod();
         $securitytokens = $this->getServiceManager()->get('Config')['dragonjsonserversecuritytoken']['securitytokens'];
         foreach ($securitytokens as $namespace => $securitytoken) {
             if (substr($method, 0, strlen($namespace . '.')) != $namespace . '.') {
                 continue;
             }
             if ($request->getParam('securitytoken') != $securitytoken) {
                 throw new \DragonJsonServer\Exception('invalid securitytoken', ['namespace' => $namespace]);
             }
         }
     });
     $sharedManager->attach('DragonJsonServer\\Service\\Server', 'Servicemap', function (\DragonJsonServer\Event\Servicemap $eventServicemap) {
         $securitytokens = $this->getServiceManager()->get('Config')['dragonjsonserversecuritytoken']['securitytokens'];
         foreach ($eventServicemap->getServicemap()->getServices() as $method => $service) {
             foreach ($securitytokens as $namespace => $securitytoken) {
                 $namespace .= '.';
                 if (substr($method, 0, strlen($namespace)) != $namespace) {
                     continue;
                 }
                 $service->addParams([['type' => 'string', 'name' => 'securitytoken', 'optional' => false]]);
             }
         }
     });
 }
開發者ID:dragonprojects,項目名稱:dragonjsonserversecuritytoken,代碼行數:33,代碼來源:Module.php

示例2: init

 /**
  * Module init
  *
  * @param ModuleManager $moduleManager
  */
 public function init(ModuleManager $moduleManager)
 {
     $sm = $moduleManager->getEvent()->getParam('ServiceManager');
     $serviceListener = $sm->get('ServiceListener');
     $serviceListener->addServiceManager('ZfApigilityDoctrineQueryProviderManager', 'zf-apigility-doctrine-query-provider', 'ZF\\Apigility\\Doctrine\\Server\\Query\\Provider\\QueryProviderInterface', 'getZfApigilityDoctrineQueryProviderConfig');
     $serviceListener->addServiceManager('ZfApigilityDoctrineQueryCreateFilterManager', 'zf-apigility-doctrine-query-create-filter', 'ZF\\Apigility\\Doctrine\\Server\\Query\\CreateFilter\\QueryCreateFilterInterface', 'getZfApigilityDoctrineQueryCreateFilterConfig');
 }
開發者ID:API-Skeletons,項目名稱:zf-apigility-doctrine,代碼行數:12,代碼來源:Module.php

示例3: init

 public function init(ModuleManager $moduleManager)
 {
     $sharedEvents = $moduleManager->getEventManager()->getSharedManager();
     // $sharedEvents->attach("Zend\Mvc\Controller\AbstractActionController",
     // MvcEvent::EVENT_DISPATCH,
     // array($this,'validaAuth'),100);
 }
開發者ID:abelclopes,項目名稱:ZF2-Intermediario-com-acl,代碼行數:7,代碼來源:Module.php

示例4: init

 /**
  * Llamo a este método cuando se llama al módulo
  * @param \Zend\ModuleManager\ModuleManager $moduleManager
  */
 public function init(ModuleManager $moduleManager)
 {
     $sharedEvents = $moduleManager->getEventManager()->getSharedManager();
     $sharedEvents->attach(__NAMESPACE__, 'dispatch', function ($e) {
         $controller = $e->getTarget();
     }, 100);
 }
開發者ID:rodrigogk87,項目名稱:djme,代碼行數:11,代碼來源:Module.php

示例5: init

 /**
  * Register a specification for the InputFilterManager with the ServiceListener.
  *
  * @param \Zend\ModuleManager\ModuleManager $moduleManager
  * @return void
  */
 public function init($moduleManager)
 {
     $event = $moduleManager->getEvent();
     $container = $event->getParam('ServiceManager');
     $serviceListener = $container->get('ServiceListener');
     $serviceListener->addServiceManager('InputFilterManager', 'input_filters', 'Zend\\ModuleManager\\Feature\\InputFilterProviderInterface', 'getInputFilterConfig');
 }
開發者ID:zendframework,項目名稱:zend-inputfilter,代碼行數:13,代碼來源:Module.php

示例6: init

 public function init(ModuleManager $moduleManager)
 {
     $moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, array($this, 'setOptions'), 1010);
     $moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, array($this, 'addLocaleToRoutes'), 1000);
     // a little hacky but it avoid rewriting of many codes
     $moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, array($this, 'overrideViewHelperUrl'));
 }
開發者ID:joacub,項目名稱:libra-locale,代碼行數:7,代碼來源:Module.php

示例7: init

 /**
  * Wird bei der Initialisierung des Moduls aufgerufen
  * @param \Zend\ModuleManager\ModuleManager $moduleManager
  */
 public function init(\Zend\ModuleManager\ModuleManager $moduleManager)
 {
     $sharedManager = $moduleManager->getEventManager()->getSharedManager();
     $sharedManager->attach('DragonJsonServer\\Service\\Server', 'Response', function (\DragonJsonServer\Event\Response $eventResponse) {
         $this->getServiceManager()->get('\\DragonJsonServerRequestlog\\Service\\Requestlog')->createRequestlog($eventResponse->getRequest(), $eventResponse->getResponse());
     });
 }
開發者ID:dragonprojects,項目名稱:dragonjsonserverrequestlog,代碼行數:11,代碼來源:Module.php

示例8: init

 public function init(ModuleManager $moduleManager)
 {
     $sm = $moduleManager->getEvent()->getParam('ServiceManager');
     /* @var $serviceListener \Zend\ModuleManager\Listener\ServiceListener */
     $serviceListener = $sm->get('ServiceListener');
     $serviceListener->addServiceManager('FormatterManager', 'formatter_manager', 'Formatter\\FormatterManager\\FormatterManager', 'getFormatterPluginConfig');
 }
開發者ID:gianarb,項目名稱:zf2-formatter,代碼行數:7,代碼來源:Module.php

示例9: init

 public function init(ModuleManager $moduleManager)
 {
     $serviceManager = $moduleManager->getEvent()->getParam('ServiceManager');
     $serviceListener = $serviceManager->get('ServiceListener');
     $serviceListener->addServiceManager('ZF\\Doctrine\\ORM\\QueryBuilder\\Filter\\Service\\FilterManager', 'zf-doctrine-orm-querybuilder-filter', 'ZF\\Doctrine\\QueryBuilder\\Filter\\FilterInterface', 'getDoctrineORMQueryBuilderFilterConfig');
     $serviceListener->addServiceManager('ZF\\Doctrine\\ORM\\QueryBuilder\\OrderBy\\Service\\OrderByManager', 'zf-doctrine-orm-querybuilder-orderby', 'ZF\\Doctrine\\QueryBuilder\\OrderBy\\OrderByInterface', 'getDoctrineORMQueryBuilderOrderByConfig');
 }
開發者ID:api-skeletons,項目名稱:zf-doctrine-orm-querybuilder,代碼行數:7,代碼來源:Module.php

示例10: createService

 /**
  * Creates and returns the module manager
  *
  * Instantiates the default module listeners, providing them configuration
  * from the "module_listener_options" key of the ApplicationConfig
  * service. Also sets the default config glob path.
  *
  * Module manager is instantiated and provided with an EventManager, to which
  * the default listener aggregate is attached. The ModuleEvent is also created
  * and attached to the module manager.
  *
  * @param ServiceLocatorInterface $serviceLocator Service Manager
  *
  * @return ModuleManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $moduleCollection = new ModuleCollection();
     $modules = $moduleCollection->getModules();
     $array = array();
     $autoloader = AutoloaderFactory::getRegisteredAutoloader(AutoloaderFactory::STANDARD_AUTOLOADER);
     foreach ($modules as $module) {
         $array[] = $module->getName();
         $path = GC_APPLICATION_PATH . '/library/Modules/' . $module->getName();
         if (file_exists($path) === false) {
             $path = GC_APPLICATION_PATH . '/extensions/Modules/' . $module->getName();
         }
         $autoloader->registerNamespace($module->getName(), $path);
     }
     $autoloader->register();
     $application = $serviceLocator->get('Application');
     $configuration = $serviceLocator->get('ApplicationConfig');
     $configuration['module_listener_options']['module_paths'] = array('./library/Modules', './extensions/Modules');
     $listenerOptions = new Listener\ListenerOptions($configuration['module_listener_options']);
     $defaultListeners = new Listener\DefaultListenerAggregate($listenerOptions);
     $serviceListener = new Listener\ServiceListener($serviceLocator);
     $this->prepareServices($serviceListener, $serviceLocator);
     $moduleManager = new ModuleManager($array, $application->getEventManager());
     $moduleManager->getEventManager()->attachAggregate($defaultListeners);
     $moduleManager->getEventManager()->attachAggregate($serviceListener);
     $moduleManager->loadModules();
     $config = $moduleManager->getEvent()->getConfigListener()->getMergedConfig(false);
     $this->prepareConfig($serviceLocator, $config);
     foreach ($moduleManager->getLoadedModules() as $module) {
         if (method_exists($module, 'onBootstrap')) {
             $module->onBootstrap($application->getMvcEvent());
         }
     }
     return $moduleManager;
 }
開發者ID:gotcms,項目名稱:gotcms,代碼行數:50,代碼來源:ModuleManagerFactory.php

示例11: init

 /**
  * Wird bei der Initialisierung des Moduls aufgerufen
  * @param \Zend\ModuleManager\ModuleManager $moduleManager
  */
 public function init(\Zend\ModuleManager\ModuleManager $moduleManager)
 {
     $sharedManager = $moduleManager->getEventManager()->getSharedManager();
     $sharedManager->attach('DragonJsonServer\\Service\\Clientmessages', 'Clientmessages', function (\DragonJsonServer\Event\Clientmessages $eventClientmessages) {
         $serviceManager = $this->getServiceManager();
         $serviceAllianceavatar = $serviceManager->get('\\DragonJsonServerAlliance\\Service\\Allianceavatar');
         $allianceavatar = $serviceAllianceavatar->getAllianceavatar();
         if (!isset($allianceavatar)) {
             $avatar = $serviceManager->get('\\DragonJsonServerAvatar\\Service\\Avatar')->getAvatar();
             if (!isset($avatar)) {
                 return;
             }
             $allianceavatar = $serviceAllianceavatar->getAllianceavatarByAvatar($avatar, false);
             if (!isset($allianceavatar)) {
                 return;
             }
         }
         $allianceclientmessages = $serviceManager->get('\\DragonJsonServerAllianceclientmessage\\Service\\Allianceclientmessage')->getAllianceclientmessagesByAllianceIdAndEventClientmessages($allianceavatar->getAllianceId(), $eventClientmessages);
         $serviceClientmessages = $serviceManager->get('\\DragonJsonServer\\Service\\Clientmessages');
         foreach ($allianceclientmessages as $allianceclientmessage) {
             $serviceClientmessages->addClientmessage($allianceclientmessage->getKey(), $allianceclientmessage->getData());
         }
     });
     $sharedManager->attach('DragonJsonServerAlliance\\Service\\Alliance', 'RemoveAlliance', function (\DragonJsonServerAlliance\Event\RemoveAlliance $eventRemoveAlliance) {
         $alliance = $eventRemoveAlliance->getAlliance();
         $this->getServiceManager()->get('\\DragonJsonServerAllianceclientmessage\\Service\\Allianceclientmessage')->removeAllianceclientmessagesByAllianceId($alliance->getAllianceId());
     });
 }
開發者ID:dragonprojects,項目名稱:dragonjsonserverallianceclientmessage,代碼行數:32,代碼來源:Module.php

示例12: init

 /**
  * @param \Zend\ModuleManager\ModuleManager $mm
  */
 public function init(\Zend\ModuleManager\ModuleManager $mm)
 {
     $mm->getEventManager()->getSharedManager()->attach(__NAMESPACE__, 'dispatch', function ($e) {
         /** @var MvcEvent $e */
         $e->getTarget()->layout('layout/admin');
     }, 100);
 }
開發者ID:kokspflanze,項目名稱:PServerAdminStatistic,代碼行數:10,代碼來源:Module.php

示例13: init

 /**
  * Module ini function that import the current domain files or it's alias
  *
  * @param ModuleManager $moduleManager
  */
 public function init(ModuleManager $moduleManager)
 {
     $events = $moduleManager->getEventManager();
     $events->attach(ModuleEvent::EVENT_MERGE_CONFIG, function (EventInterface $e) {
         $configListener = $e->getConfigListener();
         $config = $configListener->getMergedConfig(false);
         $domain = DomainService::getDomain();
         $domainDir = null;
         if (!isset($config[$domain])) {
             if (isset($config['losdomain']['domain_dir'])) {
                 $domainDir = $config['losdomain']['domain_dir'];
                 $domainConfig = DomainOptions::importDomain($domainDir, $domain);
                 $config = ArrayUtils::merge($config, $domainConfig);
                 $configListener->setMergedConfig($config);
             }
         }
         if ($domainDir !== null && isset($config[$domain]) && array_key_exists('alias', $config[$domain])) {
             $alias = $config[$domain]['alias'];
             $aliasConfig = DomainOptions::importDomain($domainDir, $alias);
             $config[$domain] = $aliasConfig[$alias];
             $config = ArrayUtils::merge($config, $aliasConfig);
             unset($config[$alias]);
             $configListener->setMergedConfig($config);
         }
     });
 }
開發者ID:Ellipizle,項目名稱:LosDomain,代碼行數:31,代碼來源:Module.php

示例14: init

 /**
  * Register a specification for the FormElementManager with the ServiceListener.
  *
  * @param \Zend\ModuleManager\ModuleManager $moduleManager
  * @return void
  */
 public function init($moduleManager)
 {
     $event = $moduleManager->getEvent();
     $container = $event->getParam('ServiceManager');
     $serviceListener = $container->get('ServiceListener');
     $serviceListener->addServiceManager('FormElementManager', 'form_elements', 'Zend\\ModuleManager\\Feature\\FormElementProviderInterface', 'getFormElementConfig');
 }
開發者ID:zendframework,項目名稱:zend-form,代碼行數:13,代碼來源:Module.php

示例15: createService

 /**
  * Creates and returns the module manager
  *
  * Instantiates the default module listeners, providing them configuration
  * from the "module_listener_options" key of the ApplicationConfig
  * service. Also sets the default config glob path.
  *
  * Module manager is instantiated and provided with an EventManager, to which
  * the default listener aggregate is attached. The ModuleEvent is also created
  * and attached to the module manager.
  *
  * @param  ServiceLocatorInterface $serviceLocator
  * @return ModuleManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     if (!$serviceLocator->has('ServiceListener')) {
         $serviceLocator->setFactory('ServiceListener', 'Console\\Service\\ServiceListenerFactory');
     }
     $configuration = $serviceLocator->get('ApplicationConfig');
     $listenerOptions = new ListenerOptions($configuration['module_listener_options']);
     $defaultListeners = new DefaultListenerAggregate($listenerOptions);
     $serviceListener = $serviceLocator->get('ServiceListener');
     $serviceListener->addServiceManager($serviceLocator, 'service_manager', 'Zend\\ModuleManager\\Feature\\ServiceProviderInterface', 'getServiceConfig');
     $serviceListener->addServiceManager('ValidatorManager', 'validators', 'Zend\\ModuleManager\\Feature\\ValidatorProviderInterface', 'getValidatorConfig');
     $serviceListener->addServiceManager('FilterManager', 'filters', 'Zend\\ModuleManager\\Feature\\FilterProviderInterface', 'getFilterConfig');
     $serviceListener->addServiceManager('SerializerAdapterManager', 'serializers', 'Zend\\ModuleManager\\Feature\\SerializerProviderInterface', 'getSerializerConfig');
     $serviceListener->addServiceManager('SerializerAdapterManager', 'serializers', 'Zend\\ModuleManager\\Feature\\SerializerProviderInterface', 'getSerializerConfig');
     $serviceListener->addServiceManager('HydratorManager', 'hydrators', 'Zend\\ModuleManager\\Feature\\HydratorProviderInterface', 'getHydratorConfig');
     $serviceListener->addServiceManager('InputFilterManager', 'input_filters', 'Zend\\ModuleManager\\Feature\\InputFilterProviderInterface', 'getInputFilterConfig');
     $events = $serviceLocator->get('EventManager');
     $events->attach($defaultListeners);
     $events->attach($serviceListener);
     $moduleEvent = new ModuleEvent();
     $moduleEvent->setParam('ServiceManager', $serviceLocator);
     $moduleManager = new ModuleManager($configuration['modules'], $events);
     $moduleManager->setEvent($moduleEvent);
     return $moduleManager;
 }
開發者ID:scottasmith,項目名稱:zf2-orm-app,代碼行數:39,代碼來源:ModuleManagerFactory.php


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