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 / RequestFactory.php
blob729a71ecada09ac2b6393b4c22a4134ae7123678
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\Console\Console;
13 use Zend\Console\Request as ConsoleRequest;
14 use Zend\Http\PhpEnvironment\Request as HttpRequest;
15 use Zend\ServiceManager\FactoryInterface;
16 use Zend\ServiceManager\ServiceLocatorInterface;
18 class RequestFactory implements FactoryInterface
20 /**
21 * Create and return a request instance, according to current environment.
23 * @param ServiceLocatorInterface $serviceLocator
24 * @return ConsoleRequest|HttpRequest
26 public function createService(ServiceLocatorInterface $serviceLocator)
28 if (Console::isConsole()) {
29 return new ConsoleRequest();
32 return new HttpRequest();