当前位置: 首页>>代码示例>>PHP>>正文


PHP Request::getFiles方法代码示例

本文整理汇总了PHP中Symfony\Component\BrowserKit\Request::getFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getFiles方法的具体用法?PHP Request::getFiles怎么用?PHP Request::getFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\BrowserKit\Request的用法示例。


在下文中一共展示了Request::getFiles方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doRequest

 /**
  * @param Request $request
  *
  * @return Response
  * @throws \Exception
  */
 public function doRequest($request)
 {
     $inputStream = fopen('php://memory', 'r+');
     $content = $request->getContent();
     if ($content !== null) {
         fwrite($inputStream, $content);
         rewind($inputStream);
     }
     $queryParams = [];
     $postParams = [];
     $queryString = parse_url($request->getUri(), PHP_URL_QUERY);
     if ($queryString != '') {
         parse_str($queryString, $queryParams);
     }
     if ($request->getMethod() !== 'GET') {
         $postParams = $request->getParameters();
     }
     $serverParams = $request->getServer();
     if (!isset($serverParams['SCRIPT_NAME'])) {
         //required by WhoopsErrorHandler
         $serverParams['SCRIPT_NAME'] = 'Codeception';
     }
     $zendRequest = new ServerRequest($serverParams, $this->convertFiles($request->getFiles()), $request->getUri(), $request->getMethod(), $inputStream, $this->extractHeaders($request));
     $zendRequest = $zendRequest->withCookieParams($request->getCookies())->withQueryParams($queryParams)->withParsedBody($postParams);
     $cwd = getcwd();
     chdir(codecept_root_dir());
     $this->application->run($zendRequest);
     chdir($cwd);
     $this->request = $zendRequest;
     $response = $this->responseCollector->getResponse();
     $this->responseCollector->clearResponse();
     return new Response($response->getBody(), $response->getStatusCode(), $response->getHeaders());
 }
开发者ID:solutionDrive,项目名称:Codeception,代码行数:39,代码来源:ZendExpressive.php

示例2: doRequest

 /**
  * @param Request $request
  *
  * @return Response
  */
 public function doRequest($request)
 {
     $_COOKIE = $request->getCookies();
     $_SERVER = $request->getServer();
     $_FILES = $request->getFiles();
     $_SERVER['REQUEST_METHOD'] = $method = strtoupper($request->getMethod());
     $_SERVER['REQUEST_URI'] = str_replace('http://localhost', '', $request->getUri());
     $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     if ($method === 'HEAD' || $method === 'GET') {
         $_GET = $request->getParameters();
         $_POST = [];
     } else {
         $_GET = [];
         $_POST = $request->getParameters();
     }
     $container = call_user_func($this->containerAccessor);
     $httpRequest = $container->getByType(IRequest::class);
     $httpResponse = $container->getByType(IResponse::class);
     if (!$httpRequest instanceof HttpRequest || !$httpResponse instanceof HttpResponse) {
         throw new Exception('Arachne\\Codeception\\DI\\HttpExtension is not used or conflicts with another extension.');
     }
     $httpRequest->reset();
     $httpResponse->reset();
     try {
         ob_start();
         $container->getByType(Application::class)->run();
         $content = ob_get_clean();
     } catch (Exception $e) {
         ob_end_clean();
         throw $e;
     }
     $code = $httpResponse->getCode();
     $headers = $httpResponse->getHeaders();
     return new Response($content, $code, $headers);
 }
开发者ID:arachne,项目名称:codeception,代码行数:40,代码来源:NetteConnector.php

示例3: doRequest

 /**
  *
  * @param \Symfony\Component\BrowserKit\Request $request
  *
  * @return \Symfony\Component\BrowserKit\Response
  */
 public function doRequest($request)
 {
     $this->_headers = array();
     $_COOKIE = array_merge($_COOKIE, $request->getCookies());
     $_SERVER = array_merge($_SERVER, $request->getServer());
     $_FILES = $this->remapFiles($request->getFiles());
     $_REQUEST = $this->remapRequestParameters($request->getParameters());
     if (strtoupper($request->getMethod()) == 'GET') {
         $_GET = $_REQUEST;
     } else {
         $_POST = $_REQUEST;
     }
     // Parse url parts
     $uriPath = trim(parse_url($request->getUri(), PHP_URL_PATH), '/');
     $uriQuery = ltrim(parse_url($request->getUri(), PHP_URL_QUERY), '?');
     $scriptName = trim(parse_url($this->url, PHP_URL_PATH), '/');
     if (!empty($uriQuery)) {
         $uriPath .= "?{$uriQuery}";
         parse_str($uriQuery, $params);
         foreach ($params as $k => $v) {
             $_GET[$k] = $v;
         }
     }
     // Add script name to request if none
     if (strpos($uriPath, $scriptName) === false) {
         $uriPath = "/{$scriptName}/{$uriPath}";
     }
     // Add forward slash if not exists
     if (strpos($uriPath, '/') !== 0) {
         $uriPath = "/{$uriPath}";
     }
     $_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
     $_SERVER['REQUEST_URI'] = $uriPath;
     /**
      * Hack to be sure that CHttpRequest will resolve route correctly
      */
     $_SERVER['SCRIPT_NAME'] = "/{$scriptName}";
     $_SERVER['SCRIPT_FILENAME'] = $this->appPath;
     ob_start();
     Yii::setApplication(null);
     Yii::createApplication($this->appSettings['class'], $this->appSettings['config']);
     // disabling logging. Logs slow down test execution
     if (Yii::app()->hasComponent('log')) {
         foreach (Yii::app()->getComponent('log')->routes as $route) {
             $route->enabled = false;
         }
     }
     Yii::app()->onEndRequest->add(array($this, 'setHeaders'));
     Yii::app()->run();
     $content = ob_get_clean();
     $headers = $this->getHeaders();
     $statusCode = 200;
     foreach ($headers as $header => $val) {
         if ($header == 'Location') {
             $statusCode = 302;
         }
     }
     $response = new Response($content, $statusCode, $this->getHeaders());
     return $response;
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:66,代码来源:Yii1.php

示例4: createClient

 protected function createClient(Request $request)
 {
     $client = $this->createZendClient();
     $client->setUri($request->getUri());
     $client->setConfig(array_merge(array('maxredirects' => 0, 'timeout' => 30, 'useragent' => $this->server['HTTP_USER_AGENT'], 'adapter' => 'Zend\\Http\\Client\\Adapter\\Socket'), $this->zendConfig));
     $client->setMethod(strtoupper($request->getMethod()));
     if ('POST' == $request->getMethod()) {
         $client->setParameterPost($request->getParameters());
     }
     $client->setHeaders($this->headers);
     if ($this->auth !== null) {
         $client->setAuth($this->auth['user'], $this->auth['password'], $this->auth['type']);
     }
     foreach ($this->getCookieJar()->allValues($request->getUri()) as $name => $value) {
         $client->addCookie($name, $value);
     }
     foreach ($request->getFiles() as $name => $info) {
         if (isset($info['tmp_name']) && '' !== $info['tmp_name']) {
             $filename = $info['name'];
             if (false === ($data = @file_get_contents($info['tmp_name']))) {
                 throw new \RuntimeException("Unable to read file '{$filename}' for upload");
             }
             $client->setFileUpload($filename, $name, $data);
         }
     }
     return $client;
 }
开发者ID:robo47,项目名称:Goutte,代码行数:27,代码来源:Client.php

示例5: doRequest

 /**
  *
  * @param \Symfony\Component\BrowserKit\Request $request
  *
  * @return \Symfony\Component\BrowserKit\Response
  */
 public function doRequest($request)
 {
     $_COOKIE = $request->getCookies();
     $_SERVER = $request->getServer();
     $_FILES = $request->getFiles();
     $_REQUEST = $request->getParameters();
     $_POST = $_GET = array();
     if (strtoupper($request->getMethod()) == 'GET') {
         $_GET = $request->getParameters();
     } else {
         $_POST = $request->getParameters();
     }
     $uri = $request->getUri();
     $pathString = parse_url($uri, PHP_URL_PATH);
     $queryString = parse_url($uri, PHP_URL_QUERY);
     $_SERVER['REQUEST_URI'] = $queryString === null ? $pathString : $pathString . '?' . $queryString;
     $_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
     parse_str($queryString, $params);
     foreach ($params as $k => $v) {
         $_GET[$k] = $v;
     }
     $app = $this->startApp();
     $app->getResponse()->on(YiiResponse::EVENT_AFTER_PREPARE, array($this, 'processResponse'));
     $this->headers = array();
     $this->statusCode = null;
     ob_start();
     $app->handleRequest($app->getRequest())->send();
     $content = ob_get_clean();
     // catch "location" header and display it in debug, otherwise it would be handled
     // by symfony browser-kit and not displayed.
     if (isset($this->headers['location'])) {
         Debug::debug("[Headers] " . json_encode($this->headers));
     }
     return new Response($content, $this->statusCode, $this->headers);
 }
开发者ID:gargallo,项目名称:tfs-test,代码行数:41,代码来源:Yii2.php

示例6: filterRequest

 /**
  * Converts the BrowserKit request to a HttpKernel request.
  *
  * @param DomRequest $request A DomRequest instance
  * @return Request A Request instance
  */
 protected function filterRequest(DomRequest $request)
 {
     $httpRequest = Request::create($request->getUri(), $request->getMethod(), $request->getParameters(), $request->getCookies(), $request->getFiles(), $request->getServer(), $request->getContent());
     foreach ($this->filterFiles($httpRequest->files->all()) as $key => $value) {
         $httpRequest->files->set($key, $value);
     }
     return $httpRequest;
 }
开发者ID:arisro,项目名称:behat-lumen-extension,代码行数:14,代码来源:LumenClient.php

示例7: doRequest

 /**
  *
  * @param \Symfony\Component\BrowserKit\Request $request
  *
  * @return \Symfony\Component\BrowserKit\Response
  */
 public function doRequest($request)
 {
     $_COOKIE = $request->getCookies();
     $_SERVER = $request->getServer();
     $_FILES = $this->remapFiles($request->getFiles());
     $_REQUEST = $this->remapRequestParameters($request->getParameters());
     $_POST = $_GET = [];
     if (strtoupper($request->getMethod()) == 'GET') {
         $_GET = $_REQUEST;
     } else {
         $_POST = $_REQUEST;
     }
     $uri = $request->getUri();
     $pathString = parse_url($uri, PHP_URL_PATH);
     $queryString = parse_url($uri, PHP_URL_QUERY);
     $_SERVER['REQUEST_URI'] = $queryString === null ? $pathString : $pathString . '?' . $queryString;
     $_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
     parse_str($queryString, $params);
     foreach ($params as $k => $v) {
         $_GET[$k] = $v;
     }
     $app = $this->getApplication();
     $app->getResponse()->on(YiiResponse::EVENT_AFTER_PREPARE, [$this, 'processResponse']);
     // disabling logging. Logs are slowing test execution down
     foreach ($app->log->targets as $target) {
         $target->enabled = false;
     }
     $this->headers = array();
     $this->statusCode = null;
     ob_start();
     $yiiRequest = $app->getRequest();
     $yiiRequest->setRawBody($request->getContent());
     $yiiRequest->setBodyParams($_POST);
     $yiiRequest->setQueryParams($_GET);
     try {
         $app->handleRequest($yiiRequest)->send();
     } catch (\Exception $e) {
         if ($e instanceof HttpException) {
             // we shouldn't discard existing output as PHPUnit preform output level verification since PHPUnit 4.2.
             $app->errorHandler->discardExistingOutput = false;
             $app->errorHandler->handleException($e);
         } elseif ($e instanceof ExitException) {
             // nothing to do
         } else {
             // for exceptions not related to Http, we pass them to Codeception
             $this->resetApplication();
             throw $e;
         }
     }
     $content = ob_get_clean();
     // catch "location" header and display it in debug, otherwise it would be handled
     // by symfony browser-kit and not displayed.
     if (isset($this->headers['location'])) {
         Debug::debug("[Headers] " . json_encode($this->headers));
     }
     $this->resetApplication();
     return new Response($content, $this->statusCode, $this->headers);
 }
开发者ID:vladislavl-hyuna,项目名称:crmapp,代码行数:64,代码来源:Yii2.php

示例8: filterRequest

 /**
  * Converts the BrowserKit request to a HttpKernel request.
  *
  * @param DomRequest $request A Request instance
  *
  * @return Request A Request instance
  */
 protected function filterRequest(DomRequest $request)
 {
     $httpRequest = Request::create($request->getUri(), $request->getMethod(), $request->getParameters(), $request->getCookies(), $request->getFiles(), $request->getServer(), $request->getContent());
     /** this happens so we can send oauth2 tokens in the header */
     if (isset($this->server['HTTP_AUTHORIZATION'])) {
         $httpRequest->headers->add(array('HTTP_AUTHORIZATION' => $this->server['HTTP_AUTHORIZATION']));
     }
     $httpRequest->files->replace($this->filterFiles($httpRequest->files->all()));
     return $httpRequest;
 }
开发者ID:dazz,项目名称:oauth2-server-httpfoundation-webtest,代码行数:17,代码来源:Client.php

示例9: filterRequest

 /**
  * Filters the BrowserKit request to the cake one.
  *
  * @param \Symfony\Component\BrowserKit\Request $request BrowserKit request.
  * @return \Cake\Network\Request Cake request.
  */
 protected function filterRequest(\Symfony\Component\BrowserKit\Request $request)
 {
     $url = preg_replace('/^https?:\\/\\/[a-z0-9\\-\\.]+/', '', $request->getUri());
     $_ENV = $environment = ['REQUEST_METHOD' => $request->getMethod()] + $request->getServer();
     $props = ['url' => $url, 'post' => (array) $request->getParameters(), 'files' => (array) $request->getFiles(), 'cookies' => (array) $request->getCookies(), 'session' => $this->getSession(), 'environment' => $environment];
     $this->cake['request'] = new Request($props);
     // set params
     Router::setRequestInfo($this->cake['request']);
     $this->cake['request']->params = Router::parse($url);
     return $this->cake['request'];
 }
开发者ID:cakephp,项目名称:codeception,代码行数:17,代码来源:Connector.php

示例10: filterRequest

 protected function filterRequest(Request $request)
 {
     $server = $request->getServer();
     $uri = Url::factory($request->getUri());
     $server['HTTP_HOST'] = $uri->getHost();
     $port = $uri->getPort();
     if ($port !== null && $port !== 443 && $port != 80) {
         $server['HTTP_HOST'] .= ':' . $port;
     }
     return new Request($request->getUri(), $request->getMethod(), $request->getParameters(), $request->getFiles(), $request->getCookies(), $server, $request->getContent());
 }
开发者ID:lenninsanchez,项目名称:donadores,代码行数:11,代码来源:Goutte.php

示例11: doRequest

 /**
  * Makes a request.
  *
  * @param \Symfony\Component\BrowserKit\Request $request
  *
  * @return \Symfony\Component\BrowserKit\Response
  * @throws \RuntimeException
  */
 public function doRequest($request)
 {
     $application = $this->getApplication();
     $di = $application->getDI();
     Di::reset();
     Di::setDefault($di);
     $_SERVER = [];
     foreach ($request->getServer() as $key => $value) {
         $_SERVER[strtoupper(str_replace('-', '_', $key))] = $value;
     }
     if (!$application instanceof Application && !$application instanceof MicroApplication) {
         throw new RuntimeException('Unsupported application class.');
     }
     $_COOKIE = $request->getCookies();
     $_FILES = $this->remapFiles($request->getFiles());
     $_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
     $_REQUEST = $this->remapRequestParameters($request->getParameters());
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         $_GET = $_REQUEST;
     } else {
         $_POST = $_REQUEST;
     }
     $uri = str_replace('http://localhost', '', $request->getUri());
     $_SERVER['REQUEST_URI'] = $uri;
     $_GET['_url'] = strtok($uri, '?');
     $_SERVER['QUERY_STRING'] = http_build_query($_GET);
     $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     $di['request'] = Stub::construct($di->get('request'), [], ['getRawBody' => $request->getContent()]);
     $response = $application->handle();
     $headers = $response->getHeaders();
     $status = (int) $headers->get('Status');
     $headersProperty = new ReflectionProperty($headers, '_headers');
     $headersProperty->setAccessible(true);
     $headers = $headersProperty->getValue($headers);
     if (!is_array($headers)) {
         $headers = [];
     }
     $cookiesProperty = new ReflectionProperty($di['cookies'], '_cookies');
     $cookiesProperty->setAccessible(true);
     $cookies = $cookiesProperty->getValue($di['cookies']);
     if (is_array($cookies)) {
         $restoredProperty = new ReflectionProperty('\\Phalcon\\Http\\Cookie', '_restored');
         $restoredProperty->setAccessible(true);
         $valueProperty = new ReflectionProperty('\\Phalcon\\Http\\Cookie', '_value');
         $valueProperty->setAccessible(true);
         foreach ($cookies as $name => $cookie) {
             if (!$restoredProperty->getValue($cookie)) {
                 $clientCookie = new Cookie($name, $valueProperty->getValue($cookie), $cookie->getExpiration(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure(), $cookie->getHttpOnly());
                 $headers['Set-Cookie'][] = (string) $clientCookie;
             }
         }
     }
     return new Response($response->getContent(), $status ? $status : 200, $headers);
 }
开发者ID:vladislavl-hyuna,项目名称:crmapp,代码行数:62,代码来源:Phalcon.php

示例12: createClient

 protected function createClient(Request $request)
 {
     // create new request without content body
     $client = parent::createClient(new Request($request->getUri(), $request->getMethod(), $request->getParameters(), $request->getFiles(), $request->getCookies(), $request->getServer()));
     // add server variables
     $headers = $this->headers;
     foreach ($request->getServer() as $key => $val) {
         $key = ucfirst(strtolower(str_replace(array('_', 'HTTP-'), array('-', ''), $key)));
         if (!isset($headers[$key])) {
             $headers[$key] = $val;
         }
     }
     $client->setHeaders($headers);
     return $client;
 }
开发者ID:noelg,项目名称:Mink,代码行数:15,代码来源:Client.php

示例13: doRequest

 /**
  *
  * @param \Symfony\Component\BrowserKit\Request $request
  * @return \Symfony\Component\BrowserKit\Response
  */
 public function doRequest($request)
 {
     $_COOKIE = $request->getCookies();
     $_SERVER = $request->getServer();
     $_FILES = $request->getFiles();
     $_REQUEST = $request->getParameters();
     if (strtoupper($request->getMethod()) == 'GET') {
         $_GET = $request->getParameters();
     } else {
         $_POST = $request->getParameters();
     }
     $uri = str_replace('http://localhost', '', $request->getUri());
     $scriptName = str_replace('http://localhost', '', $this->url);
     $queryString = parse_url($uri, PHP_URL_QUERY);
     parse_str($queryString, $params);
     if (strpos($uri, $scriptName) === false) {
         $uri = $scriptName . $queryString;
     }
     foreach ($params as $k => $v) {
         $_GET[$k] = $v;
     }
     $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     $_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
     $_SERVER['REQUEST_URI'] = $uri;
     $_SERVER['SCRIPT_NAME'] = $scriptName;
     $_SERVER['SCRIPT_FILENAME'] = $this->entryScript;
     $_SERVER['PHP_SELF'] = $this->entryScript;
     $config = (require $this->entryScript);
     /** @var \yii\web\Application $app */
     $app = Yii::createObject($config);
     $client = $this;
     $app->getResponse()->on(YiiResponse::EVENT_AFTER_PREPARE, function ($event) use($client) {
         /** @var \yii\web\Response $sender */
         $sender = $event->sender;
         $this->headers = $sender->getHeaders()->toArray();
         $sender->getHeaders()->removeAll();
         $this->statusCode = $sender->getStatusCode();
         $_POST = array();
         $sender->setStatusCode(null);
     });
     $this->headers = array();
     $this->statusCode = null;
     ob_start();
     $app->handleRequest($app->getRequest())->send();
     $content = ob_get_clean();
     return new Response($content, $this->statusCode === null ? 200 : $this->statusCode, $this->headers);
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:52,代码来源:Yii2.php

示例14: doRequestInProcess

 /**
  * @param Request $request
  * @return Response
  */
 public function doRequestInProcess($request)
 {
     if ($this->mockedResponse) {
         $response = $this->mockedResponse;
         $this->mockedResponse = null;
         return $response;
     }
     $requestCookie = $request->getCookies();
     $requestServer = $request->getServer();
     $requestFiles = $this->remapFiles($request->getFiles());
     $parseResult = parse_url($request->getUri());
     $uri = $parseResult["path"];
     if (array_key_exists("query", $parseResult)) {
         $uri .= "?" . $parseResult["query"];
     }
     $requestRequestArray = $this->remapRequestParameters($request->getParameters());
     $requestServer['REQUEST_METHOD'] = strtoupper($request->getMethod());
     $requestServer['REQUEST_URI'] = $uri;
     $requestServer['HTTP_HOST'] = $this->domain;
     $requestServer['SERVER_PROTOCOL'] = 'HTTP/1.1';
     $this->index = $this->uriToIndexMapper->getIndexForUri($uri);
     $phpSelf = str_replace($this->rootFolder, '', $this->index);
     $requestServer['PHP_SELF'] = $phpSelf;
     $env = ['headers' => $this->headers, 'cookie' => $requestCookie, 'server' => $requestServer, 'files' => $requestFiles, 'request' => $requestRequestArray];
     if (strtoupper($request->getMethod()) == 'GET') {
         $env['get'] = $env['request'];
     } else {
         $env['post'] = $env['request'];
     }
     $requestScript = dirname(dirname(__DIR__)) . '/scripts/request.php';
     $command = PHP_BINARY . ' ' . escapeshellarg($requestScript) . ' ' . escapeshellarg($this->index) . ' ' . escapeshellarg(base64_encode(serialize($env)));
     $process = new Process($command);
     $process->run();
     $rawProcessOutput = $process->getOutput();
     $unserializedResponse = unserialize(base64_decode($rawProcessOutput));
     $_SERVER = empty($unserializedResponse['server']) ? [] : $unserializedResponse['server'];
     $_FILES = empty($unserializedResponse['files']) ? [] : $unserializedResponse['files'];
     $_REQUEST = empty($unserializedResponse['request']) ? [] : $unserializedResponse['request'];
     $_GET = empty($unserializedResponse['get']) ? [] : $unserializedResponse['get'];
     $_POST = empty($unserializedResponse['post']) ? [] : $unserializedResponse['post'];
     $content = $unserializedResponse['content'];
     $headers = $this->replaceSiteUrlDeep($unserializedResponse['headers'], $this->url);
     $response = new Response($content, $unserializedResponse['status'], $headers);
     return $response;
 }
开发者ID:lucatume,项目名称:wp-browser,代码行数:49,代码来源:WordPress.php

示例15: doRequest

 /**
  * @param Request $request
  *
  * @return Response
  * @throws \Exception
  */
 public function doRequest($request)
 {
     $this->createApplication();
     $zendRequest = $this->application->getRequest();
     $uri = new HttpUri($request->getUri());
     $queryString = $uri->getQuery();
     $method = strtoupper($request->getMethod());
     $zendRequest->setCookies(new Parameters($request->getCookies()));
     $query = [];
     $post = [];
     $content = $request->getContent();
     if ($queryString) {
         parse_str($queryString, $query);
     }
     if ($method !== HttpRequest::METHOD_GET) {
         $post = $request->getParameters();
     }
     $zendRequest->setQuery(new Parameters($query));
     $zendRequest->setPost(new Parameters($post));
     $zendRequest->setFiles(new Parameters($request->getFiles()));
     $zendRequest->setContent($content);
     $zendRequest->setMethod($method);
     $zendRequest->setUri($uri);
     $requestUri = $uri->getPath();
     if (!empty($queryString)) {
         $requestUri .= '?' . $queryString;
     }
     $zendRequest->setRequestUri($requestUri);
     $zendRequest->setHeaders($this->extractHeaders($request));
     $this->application->run();
     // get the response *after* the application has run, because other ZF
     //     libraries like API Agility may *replace* the application's response
     //
     $zendResponse = $this->application->getResponse();
     $this->zendRequest = $zendRequest;
     $exception = $this->application->getMvcEvent()->getParam('exception');
     if ($exception instanceof \Exception) {
         throw $exception;
     }
     $response = new Response($zendResponse->getBody(), $zendResponse->getStatusCode(), $zendResponse->getHeaders()->toArray());
     return $response;
 }
开发者ID:solutionDrive,项目名称:Codeception,代码行数:48,代码来源:ZF2.php


注:本文中的Symfony\Component\BrowserKit\Request::getFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。