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 / DiFactory.php
blob4da63ba2b7619377edb71a5c57fb98005e3c6478
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\Di\Config;
13 use Zend\Di\Di;
14 use Zend\ServiceManager\FactoryInterface;
15 use Zend\ServiceManager\ServiceLocatorInterface;
17 class DiFactory implements FactoryInterface
19 /**
20 * Create and return abstract factory seeded by dependency injector
22 * Creates and returns an abstract factory seeded by the dependency
23 * injector. If the "di" key of the configuration service is set, that
24 * sub-array is passed to a DiConfig object and used to configure
25 * the DI instance. The DI instance is then used to seed the
26 * DiAbstractServiceFactory, which is then registered with the service
27 * manager.
29 * @param ServiceLocatorInterface $serviceLocator
30 * @return Di
32 public function createService(ServiceLocatorInterface $serviceLocator)
34 $di = new Di();
35 $config = $serviceLocator->get('Config');
37 if (isset($config['di'])) {
38 $config = new Config($config['di']);
39 $config->configure($di);
42 return $di;