diff vendor/zendframework/zend-diactoros/src/Server.php @ 2:5311817fb629

Theme updates
author Chris Cannam
date Tue, 10 Jul 2018 13:19:18 +0000
parents c75dbcec494b
children
line wrap: on
line diff
--- a/vendor/zendframework/zend-diactoros/src/Server.php	Thu Jul 05 15:32:06 2018 +0100
+++ b/vendor/zendframework/zend-diactoros/src/Server.php	Tue Jul 10 13:19:18 2018 +0000
@@ -1,23 +1,26 @@
 <?php
 /**
- * Zend Framework (http://framework.zend.com/)
- *
- * @see       http://github.com/zendframework/zend-diactoros for the canonical source repository
- * @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
+ * @see       https://github.com/zendframework/zend-diactoros for the canonical source repository
+ * @copyright Copyright (c) 2015-2018 Zend Technologies USA Inc. (http://www.zend.com)
  * @license   https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
  */
 
 namespace Zend\Diactoros;
 
 use OutOfBoundsException;
+use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use Psr\Http\Message\ResponseInterface;
+
+use function property_exists;
 
 /**
  * "Serve" incoming HTTP requests
  *
  * Given a callback, takes an incoming request, dispatches it to the
  * callback, and then sends a response.
+ *
+ * @deprecated since 1.8.0. We recommend using the `RequestHandlerRunner` class
+ *     from the zendframework/zend-httphandlerrunner package instead.
  */
 class Server
 {
@@ -150,24 +153,18 @@
      * If provided a $finalHandler, that callable will be used for
      * incomplete requests.
      *
-     * Output buffering is enabled prior to invoking the attached
-     * callback; any output buffered will be sent prior to any
-     * response body content.
-     *
      * @param null|callable $finalHandler
      */
     public function listen(callable $finalHandler = null)
     {
         $callback = $this->callback;
 
-        ob_start();
-        $bufferLevel = ob_get_level();
-
         $response = $callback($this->request, $this->response, $finalHandler);
         if (! $response instanceof ResponseInterface) {
             $response = $this->response;
         }
-        $this->getEmitter()->emit($response, $bufferLevel);
+
+        $this->getEmitter()->emit($response);
     }
 
     /**