当前位置: 首页>>代码示例>>PHP>>正文


PHP ServiceManager\AbstractPluginManager类代码示例

本文整理汇总了PHP中Zend\ServiceManager\AbstractPluginManager的典型用法代码示例。如果您正苦于以下问题:PHP AbstractPluginManager类的具体用法?PHP AbstractPluginManager怎么用?PHP AbstractPluginManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AbstractPluginManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initZendPlugin

 /**
  * Given a Zend Framework Plugin Manager, initialize the instance.
  *
  * @param object                                     $instance Instance to
  * initialize
  * @param \Zend\ServiceManager\AbstractPluginManager $manager  Plugin manager
  *
  * @return object
  */
 public static function initZendPlugin($instance, \Zend\ServiceManager\AbstractPluginManager $manager)
 {
     $sm = $manager->getServiceLocator();
     if (null !== $sm) {
         static::initInstance($instance, $sm);
     }
     return $instance;
 }
开发者ID:tillk,项目名称:vufind,代码行数:17,代码来源:Initializer.php

示例2: getServiceManager

 /**
  * @return ServiceManager
  */
 public function getServiceManager()
 {
     if (!$this->serviceManager) {
         $this->serviceManager = $this->serviceLocator->getServiceLocator();
     }
     return $this->serviceManager;
 }
开发者ID:hanif,项目名称:stokq,代码行数:10,代码来源:Nav.php

示例3: __construct

 public function __construct(\Zend\ServiceManager\ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->setInvokableClass(self::GENERATOR_HUMAN, self::GENERATOR_HUMAN);
     $this->setInvokableClass(self::GENERATOR_HYBRID, self::GENERATOR_HYBRID);
     $this->setInvokableClass(self::GENERATOR_COMPUTER, self::GENERATOR_COMPUTER);
     $this->addInitializer(function (PasswordGeneratorInterface $instance, PluginManager $pm) {
         /* @var $options \XelaxPasswordGeneratorModule\Options\GeneratorOptions */
         $generatorOptions = $pm->getServiceLocator()->get('XelaxPasswordGeneratorModule\\Options\\Generator');
         $options = array();
         if (isset($generatorOptions->getGeneratorOptions()[get_class($instance)])) {
             $options = $generatorOptions->getGeneratorOptions()[get_class($instance)];
         }
         if (!empty($options['options'])) {
             foreach ($options['options'] as $key => $value) {
                 $instance->setOptionValue($key, $value);
             }
         }
         if (!empty($options['parameters'])) {
             foreach ($options['parameters'] as $key => $value) {
                 $instance->setParameter($key, $value);
             }
         }
     });
 }
开发者ID:abduluk98,项目名称:password-generator-module,代码行数:25,代码来源:PluginManager.php

示例4: __construct

 public function __construct(ConfigInterface $config = null)
 {
     parent::__construct($config);
     foreach ($this->filters as $filterName => $filterClass) {
         $this->setInvokableClass($filterName, $filterClass);
     }
 }
开发者ID:robertdamoc,项目名称:zf2-module-assets,代码行数:7,代码来源:AssetsFilterManager.php

示例5: get

 /**
  * Override: do not use peering service managers
  *
  * @param  string $name
  * @param  array $options
  * @param  bool $usePeeringServiceManagers
  * @return mixed
  */
 public function get($name, $options = [], $usePeeringServiceManagers = false)
 {
     if (is_string($options)) {
         $options = ['class_name' => $options];
     }
     return parent::get($name, $options, $usePeeringServiceManagers);
 }
开发者ID:coolms,项目名称:common,代码行数:15,代码来源:AbstractPluginManager.php

示例6: __construct

 /**
  * {@inheritDoc}
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->addInitializer(function ($instance, $serviceLocator) {
         $instance->setServiceLocator($serviceLocator->getServiceLocator());
     }, false);
 }
开发者ID:patrova,项目名称:omeka-s,代码行数:10,代码来源:Manager.php

示例7: get

 public function get($name, $options = array(), $usePeeringServiceManagers = true)
 {
     $plugin = parent::get($name, $options, $usePeeringServiceManagers);
     $plugin->setConfig($this->getConfig()->{$name});
     $plugin->setObjectManager($this->getObjectManager());
     return $plugin;
 }
开发者ID:i-xperts,项目名称:zf-oauth2-doctrine,代码行数:7,代码来源:MapperManager.php

示例8: __construct

 /**
  * Creates an instance.
  *
  * Adds two default initializers:
  * - Inject the translator to mails implementing TranslatorAwareInterface
  * - Call init() method on Mails if such method exists.
  *
  * @param ConfigInterface $configuration
  */
 public function __construct(ServiceLocatorInterface $serviceLocator, ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->serviceLocator = $serviceLocator;
     $self = $this;
     $this->addInitializer(function ($instance) use($self) {
         if ($instance instanceof TranslatorAwareInterface) {
             $translator = $self->getServiceLocator()->get('translator');
             $instance->setTranslator($translator);
             if (null === $instance->getTranslatorTextDomain()) {
                 $instance->setTranslatorTextDomain();
             }
             $instance->setTranslatorEnabled(true);
         }
     }, false);
     $this->addInitializer(function ($instance) {
         if (method_exists($instance, 'setServiceLocator')) {
             $instance->setServiceLocator($this);
         }
     }, false);
     $this->addInitializer(function ($instance) {
         if (method_exists($instance, 'init')) {
             $instance->init();
         }
     }, false);
 }
开发者ID:cross-solution,项目名称:yawik,代码行数:35,代码来源:MailService.php

示例9: get

    /**
     * Retrieve a registered instance
     *
     * After the plugin is retrieved from the service locator, inject the
     * controller in the plugin every time it is requested. This is required
     * because a controller can use a plugin and another controller can be
     * dispatched afterwards. If this second controller uses the same plugin
     * as the first controller, the reference to the controller inside the
     * plugin is lost.
     *
     * @param  string $name
     * @param  mixed  $options
     * @param  bool   $usePeeringServiceManagers
     * @return mixed
     */
    public function get($name, $options = array(), $usePeeringServiceManagers = true)
    {
        $plugin = parent::get($name, $options, $usePeeringServiceManagers);
        $this->injectController($plugin);

        return $plugin;
    }
开发者ID:Robert-Xie,项目名称:php-framework-benchmark,代码行数:22,代码来源:PluginManager.php

示例10: __construct

 /**
  * Constructor
  *
  * Merges provided configuration with default configuration.
  *
  * Adds initializers to inject the attached renderer and translator, if
  * any, to the currently requested helper.
  *
  * @param null|ConfigInterface|ContainerInterface $configOrContainerInstance
  * @param array $v3config If $configOrContainerInstance is a container, this
  *     value will be passed to the parent constructor.
  */
 public function __construct($configOrContainerInstance = null, array $v3config = [])
 {
     $this->initializers[] = [$this, 'injectRenderer'];
     $this->initializers[] = [$this, 'injectTranslator'];
     $this->initializers[] = [$this, 'injectEventManager'];
     parent::__construct($configOrContainerInstance, $v3config);
 }
开发者ID:froschdesign,项目名称:zend-view,代码行数:19,代码来源:HelperPluginManager.php

示例11: __construct

 /**
  * Creates an instance.
  *
  * {@inheritDoc}
  *
  * Adds an additional initializer to inject an event manager to assertions
  * implementing {@link EventManagerAwareInterface}.
  *
  */
 public function __construct(ServiceLocatorInterface $serviceLocator, ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $this->serviceLocator = $serviceLocator;
     // Pushing to bottom of stack to ensure this is done last
     $this->addInitializer(array($this, 'injectEventManager'), false);
 }
开发者ID:cross-solution,项目名称:yawik,代码行数:16,代码来源:AssertionManager.php

示例12: __construct

 /**
  * @param null $configOrContainerInstance
  * @param array $v3config
  */
 public function __construct($configOrContainerInstance = null, array $v3config = [])
 {
     parent::__construct($configOrContainerInstance, $v3config);
     $this->addInitializer([$this, 'injectDbAdapter']);
     $this->addInitializer([$this, 'injectHydrator']);
     $this->addInitializer([$this, 'injectModel']);
 }
开发者ID:uthando-cms,项目名称:uthando-common,代码行数:11,代码来源:MapperManager.php

示例13: __construct

 /**
  * Constructor
  *
  * After invoking parent constructor, add an initializer to inject the
  * attached renderer and translator, if any, to the currently requested helper.
  *
  * @param null $configuration
  */
 public function __construct($configuration = null)
 {
     parent::__construct(null);
     Config::has('jquery', $configuration);
     $this->config = new Config($configuration['jquery'], $this->invokableClasses);
     $this->addInitializer(array($this, 'injectConfig'));
 }
开发者ID:pedro151,项目名称:zfcomplement,代码行数:15,代码来源:JQueryPluginManager.php

示例14: get

 /**
  * @inheritdoc
  *
  * @param string $name
  * @param array $options
  * @param bool $usePeeringServiceManagers
  * @return JobInterface
  */
 public function get($name, $options = [], $usePeeringServiceManagers = true)
 {
     // parent::get calls validatePlugin() so we're sure $instance is a JobInterface
     $instance = parent::get($name, $options, $usePeeringServiceManagers);
     $instance->setMetadata('__name__', $name);
     return $instance;
 }
开发者ID:jackdpeterson,项目名称:SlmQueue,代码行数:15,代码来源:JobPluginManager.php

示例15: __construct

 /**
  * Constructor
  *
  * Make sure table gateways are properly initialized.
  *
  * @param ConfigInterface $configuration Configuration settings (optional)
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     //todo: do we need an Initializer
     //$this->addInitializer(
     //    ['VuFind\ServiceManager\Initializer', 'initPlugin'], false
     //);
 }
开发者ID:swissbib,项目名称:resources.swissbib.ch,代码行数:15,代码来源:AbstractPluginManager.php


注:本文中的Zend\ServiceManager\AbstractPluginManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。