use zend router
[GitHub/Stricted/Domain-Control-Panel.git] / vendor / Zend / Mvc / Service / ApplicationFactory.php
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
4 *
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
8 */
9
10 namespace Zend\Mvc\Service;
11
12 use Interop\Container\ContainerInterface;
13 use Zend\Mvc\Application;
14 use Zend\ServiceManager\FactoryInterface;
15 use Zend\ServiceManager\ServiceLocatorInterface;
16
17 class ApplicationFactory implements FactoryInterface
18 {
19 /**
20 * Create the Application service (v3)
21 *
22 * Creates a Zend\Mvc\Application service, passing it the configuration
23 * service and the service manager instance.
24 *
25 * @param ContainerInterface $container
26 * @param string $name
27 * @param null|array $options
28 * @return Application
29 */
30 public function __invoke(ContainerInterface $container, $name, array $options = null)
31 {
32 return new Application(
33 $container->get('config'),
34 $container,
35 $container->get('EventManager'),
36 $container->get('Request'),
37 $container->get('Response')
38 );
39 }
40
41 /**
42 * Create the Application service (v2)
43 *
44 * Proxies to __invoke().
45 *
46 * @param ServiceLocatorInterface $container
47 * @return Application
48 */
49 public function createService(ServiceLocatorInterface $container)
50 {
51 return $this($container, Application::class);
52 }
53 }