All Versions
69
Latest Version
Avg Release Cycle
45 days
Latest Release
806 days ago

Changelog History
Page 4

  • v1.8.5 Changes

    August 10, 2018

    ➕ Added

    • Nothing.

    🔄 Changed

    • Nothing.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • 🛠 zendframework/zend-diactoros#324 fixes a reference to an undefined variable in the ServerRequestFactory, which made it impossible to fetch a specific header by name.
  • v1.8.4 Changes

    August 01, 2018

    ➕ Added

    • Nothing.

    🔄 Changed

    • 🚀 This release modifies how ServerRequestFactory marshals the request URI. In prior releases, we would attempt to inspect the X-Rewrite-Url and X-Original-Url headers, using their values, if present. These headers are issued by the ISAPI_Rewrite module for IIS (developed by HeliconTech). However, we have no way of guaranteeing that the module is what issued the headers, making it an unreliable source for discovering the URI. As such, we have removed this feature in this release of Diactoros.

    If you are developing a middleware application, you can mimic the functionality via middleware as follows:

      use Psr\Http\Message\ResponseInterface;
      use Psr\Http\Message\ServerRequestInterface;
      use Psr\Http\Server\RequestHandlerInterface;
      use Laminas\Diactoros\Uri;
    
      public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
      {
          $requestUri = null;
    
          $httpXRewriteUrl = $request->getHeaderLine('X-Rewrite-Url');
          if ($httpXRewriteUrl !== null) {
              $requestUri = $httpXRewriteUrl;
          }
    
          $httpXOriginalUrl = $request->getHeaderLine('X-Original-Url');
          if ($httpXOriginalUrl !== null) {
              $requestUri = $httpXOriginalUrl;
          }
    
          if ($requestUri !== null) {
              $request = $request->withUri(new Uri($requestUri));
          }
    
          return $handler->handle($request);
      }
    

    If you use middleware such as the above, make sure you also instruct your web server to strip any incoming headers of the same name so that you can guarantee they are issued by the ISAPI_Rewrite module.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • Nothing.
  • v1.8.3 Changes

    July 24, 2018

    ➕ Added

    • Nothing.

    🔄 Changed

    • Nothing.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • ⚡️ zendframework/zend-diactoros#321 updates the logic in Uri::withPort() to ensure that it checks that the value provided is either an integer or a string integer, as only those values may be cast to integer without data loss.

    • zendframework/zend-diactoros#320 adds checking within Response to ensure that the provided reason phrase is a string; an InvalidArgumentException is now raised if it is not. This change ensures the class adheres strictly to the PSR-7 specification.

    • zendframework/zend-diactoros#319 provides a fix to Laminas\Diactoros\Response that ensures that the status code returned is always an integer (and never a string containing an integer), thus ensuring it strictly adheres to the PSR-7 specification.

  • v1.8.2 Changes

    July 19, 2018

    ➕ Added

    • Nothing.

    🔄 Changed

    • Nothing.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • 🛠 zendframework/zend-diactoros#318 fixes the logic for discovering whether an HTTPS scheme is in play to be case insensitive when comparing header and SAPI values, ensuring no false negative lookups occur.

    • zendframework/zend-diactoros#314 modifies error handling around opening a file resource within Laminas\Diactoros\Stream::setStream() to no longer use the second argument to set_error_handler(), and instead check the error type in the handler itself; this fixes an issue when the handler is nested inside another error handler, which currently has buggy behavior within the PHP engine.

  • v1.8.1 Changes

    July 09, 2018

    ➕ Added

    • Nothing.

    🔄 Changed

    • zendframework/zend-diactoros#313 changes the reason phrase associated with the status code 425 to "Too Early", corresponding to a new definition of the code as specified by the IANA.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • 🛠 zendframework/zend-diactoros#312 fixes how the normalizeUploadedFiles() utility function handles nested trees of uploaded files, ensuring it detects them properly.
  • v1.8.0 Changes

    June 27, 2018

    ➕ Added

    • zendframework/zend-diactoros#307 adds the following functions under the Laminas\Diactoros namespace, each of which may be used to derive artifacts from SAPI supergloabls for the purposes of generating a ServerRequest instance:
      • normalizeServer(array $server, callable $apacheRequestHeaderCallback = null) : array (main purpose is to aggregate the Authorization header in the SAPI params when under Apache)
      • marshalProtocolVersionFromSapi(array $server) : string
      • marshalMethodFromSapi(array $server) : string
      • marshalUriFromSapi(array $server, array $headers) : Uri
      • marshalHeadersFromSapi(array $server) : array
      • parseCookieHeader(string $header) : array
      • createUploadedFile(array $spec) : UploadedFile (creates the instance from a normal $_FILES entry)
      • normalizeUploadedFiles(array $files) : UploadedFileInterface[] (traverses a potentially nested array of uploaded file instances and/or $_FILES entries, including those aggregated under mod_php, php-fpm, and php-cgi in order to create a flat array of UploadedFileInterface instances to use in a request)

    🔄 Changed

    • Nothing.

    🗄 Deprecated

    • 🗄 zendframework/zend-diactoros#307 deprecates ServerRequestFactory::normalizeServer(); the method is no longer used internally, and users should instead use Laminas\Diactoros\normalizeServer(), to which it proxies.

    • 🗄 zendframework/zend-diactoros#307 deprecates ServerRequestFactory::marshalHeaders(); the method is no longer used internally, and users should instead use Laminas\Diactoros\marshalHeadersFromSapi(), to which it proxies.

    • 🗄 zendframework/zend-diactoros#307 deprecates ServerRequestFactory::marshalUriFromServer(); the method is no longer used internally. Users should use marshalUriFromSapi() instead.

    • 🗄 zendframework/zend-diactoros#307 deprecates ServerRequestFactory::marshalRequestUri(). the method is no longer used internally, and currently proxies to marshalUriFromSapi(), pulling the discovered path from the Uri instance returned by that function. Users should use marshalUriFromSapi() instead.

    • 🗄 zendframework/zend-diactoros#307 deprecates ServerRequestFactory::marshalHostAndPortFromHeaders(); the method is no longer used internally, and currently proxies to marshalUriFromSapi(), pulling the discovered host and port from the Uri instance returned by that function. Users should use marshalUriFromSapi() instead.

    • 🗄 zendframework/zend-diactoros#307 deprecates ServerRequestFactory::getHeader(); the method is no longer used internally. Users should copy and paste the functionality into their own applications if needed, or rely on headers from a fully-populated Uri instance instead.

    • 🗄 zendframework/zend-diactoros#307 deprecates ServerRequestFactory::stripQueryString(); the method is no longer used internally, and users can mimic the functionality via the expression $path = explode('?', $path, 2)[0];.

    • 🗄 zendframework/zend-diactoros#307 deprecates ServerRequestFactory::normalizeFiles(); the functionality is no longer used internally, and users can use normalizeUploadedFiles() as a replacement.

    • 🗄 zendframework/zend-diactoros#303 deprecates Laminas\Diactoros\Response\EmitterInterface and its various implementations. These are now provided via the laminas/laminas-httphandlerrunner package as 1:1 substitutions.

    • 🗄 zendframework/zend-diactoros#303 deprecates the Laminas\Diactoros\Server class. Users are directed to the RequestHandlerRunner class from the laminas/laminas-httphandlerrunner package as an alternative.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • Nothing.
  • v1.7.2 Changes

    May 29, 2018

    ➕ Added

    • Nothing.

    🔄 Changed

    • Nothing.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

  • v1.7.1 Changes

    February 26, 2018

    ➕ Added

    • Nothing.

    🔄 Changed

    • ⚡️ zendframework/zend-diactoros#293 updates Uri::getHost() to cast the value via strtolower() before returning it. While this represents a change, it is fixing a bug in our implementation: the PSR-7 specification for the method, which follows IETF RFC 3986 section 3.2.2, requires that the host name be normalized to lowercase.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • 🛠 zendframework/zend-diactoros#290 fixes Stream::getSize() such that it checks that the result of fstat was succesful before attempting to return its size member; in the case of an error, it now returns null.
  • v1.7.0 Changes

    January 04, 2018

    ➕ Added

    • zendframework/zend-diactoros#285 adds a new custom response type, Laminas\Diactoros\Response\XmlResponse, for generating responses representing XML. Usage is the same as with the HtmlResponse or TextResponse; the response generated will have a Content-Type: application/xml header by default.

    • zendframework/zend-diactoros#280 adds the response status code/phrase pairing "103 Early Hints" to the Response::$phrases property. This is a new status proposed via RFC 8297.

    • zendframework/zend-diactoros#279 adds explicit support for PHP 7.2; previously, we'd allowed build failures, though none occured; we now require PHP 7.2 builds to pass.

    🔄 Changed

    • Nothing.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • Nothing.
  • v1.6.1 Changes

    October 12, 2017

    ➕ Added

    • Nothing.

    🔄 Changed

    • ⚡️ zendframework/zend-diactoros#273 updates each of the SAPI emitter implementations to emit the status line after emitting other headers; this is done to ensure that the status line is not overridden by PHP.

    🗄 Deprecated

    • Nothing.

    ✂ Removed

    • Nothing.

    🛠 Fixed

    • zendframework/zend-diactoros#273 modifies how the SapiEmitterTrait calls header() to ensure that a response code is always passed as the third argument; this is done to prevent PHP from silently overriding it.