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\Mvc\Application
;
14 use Zend\ServiceManager\FactoryInterface
;
15 use Zend\ServiceManager\ServiceLocatorInterface
;
17 class ApplicationFactory
implements FactoryInterface
20 * Create the Application service (v3)
22 * Creates a Zend\Mvc\Application service, passing it the configuration
23 * service and the service manager instance.
25 * @param ContainerInterface $container
27 * @param null|array $options
30 public function __invoke(ContainerInterface
$container, $name, array $options = null)
32 return new Application(
33 $container->get('config'),
35 $container->get('EventManager'),
36 $container->get('Request'),
37 $container->get('Response')
42 * Create the Application service (v2)
44 * Proxies to __invoke().
46 * @param ServiceLocatorInterface $container
49 public function createService(ServiceLocatorInterface
$container)
51 return $this($container, Application
::class);