3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Mvc\Service
;
12 use Interop\Container\ContainerInterface
;
13 use Zend\ServiceManager\FactoryInterface
;
14 use Zend\ServiceManager\ServiceLocatorInterface
;
17 * @deprecated Since 2.7.9. The factory is now defined in zend-servicemanager-di,
18 * and removed in 3.0.0. Use Zend\ServiceManager\Di\DiStrictAbstractServiceFactoryFactory
19 * from zend-servicemanager-di if you are using zend-servicemanager v3, and/or when
20 * ready to migrate to zend-mvc 3.0.
22 class DiStrictAbstractServiceFactoryFactory
implements FactoryInterface
25 * Class responsible for instantiating a DiStrictAbstractServiceFactory
27 * @param ContainerInterface $container
29 * @param null|array $options
30 * @return DiStrictAbstractServiceFactory
32 public function __invoke(ContainerInterface
$container, $name, array $options = null)
34 $diAbstractFactory = new DiStrictAbstractServiceFactory(
35 $container->get('Di'),
36 DiStrictAbstractServiceFactory
::USE_SL_BEFORE_DI
38 $config = $container->get('config');
40 if (isset($config['di']['allowed_controllers'])) {
41 $diAbstractFactory->setAllowedServiceNames($config['di']['allowed_controllers']);
44 return $diAbstractFactory;
48 * Create and return DiStrictAbstractServiceFactory instance
50 * For use with zend-servicemanager v2; proxies to __invoke().
52 * @param ServiceLocatorInterface $container
53 * @return DiStrictAbstractServiceFactory
55 public function createService(ServiceLocatorInterface
$container)
57 return $this($container, DiStrictAbstractServiceFactory
::class);