Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Mvc / Service / AbstractPluginManagerFactory.php
blob3432b23e53f94f2dd1be4dd7b3c7ef6baa46ab72
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Mvc\Service;
12 use Zend\ServiceManager\AbstractPluginManager;
13 use Zend\ServiceManager\Di\DiAbstractServiceFactory;
14 use Zend\ServiceManager\FactoryInterface;
15 use Zend\ServiceManager\ServiceLocatorInterface;
17 abstract class AbstractPluginManagerFactory implements FactoryInterface
19 const PLUGIN_MANAGER_CLASS = 'AbstractPluginManager';
21 /**
22 * Create and return a plugin manager.
23 * Classes that extend this should provide a valid class for
24 * the PLUGIN_MANGER_CLASS constant.
26 * @param ServiceLocatorInterface $serviceLocator
27 * @return \Zend\ServiceManager\AbstractPluginManager
29 public function createService(ServiceLocatorInterface $serviceLocator)
31 $pluginManagerClass = static::PLUGIN_MANAGER_CLASS;
32 /* @var $plugins \Zend\ServiceManager\AbstractPluginManager */
33 $plugins = new $pluginManagerClass;
34 $plugins->setServiceLocator($serviceLocator);
35 $configuration = $serviceLocator->get('Config');
37 if (isset($configuration['di']) && $serviceLocator->has('Di')) {
38 $plugins->addAbstractFactory($serviceLocator->get('DiAbstractServiceFactory'));
41 return $plugins;