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 / Controller / Plugin / Service / ForwardFactory.php
blob4d974d4c374942bb67f85f8467f03b5d06e472a3
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\Controller\Plugin\Service;
12 use Zend\ServiceManager\Exception\ServiceNotCreatedException;
13 use Zend\ServiceManager\FactoryInterface;
14 use Zend\ServiceManager\ServiceLocatorInterface;
15 use Zend\Mvc\Controller\Plugin\Forward;
17 class ForwardFactory implements FactoryInterface
19 /**
20 * {@inheritDoc}
22 * @return Forward
23 * @throws ServiceNotCreatedException if ControllerLoader service is not found in application service locator
25 public function createService(ServiceLocatorInterface $plugins)
27 $services = $plugins->getServiceLocator();
28 if (!$services instanceof ServiceLocatorInterface) {
29 throw new ServiceNotCreatedException(sprintf(
30 '%s requires that the application service manager has been injected; none found',
31 __CLASS__
32 ));
35 if (!$services->has('ControllerLoader')) {
36 throw new ServiceNotCreatedException(sprintf(
37 '%s requires that the application service manager contains a "%s" service; none found',
38 __CLASS__,
39 'ControllerLoader'
40 ));
42 $controllers = $services->get('ControllerLoader');
44 return new Forward($controllers);