Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

zend-diactoros 1.8.0

Compare
Choose a tag to compare
@weierophinney weierophinney released this 27 Jun 19:14
· 293 commits to master since this release

Added

  • #307 adds the following functions under the Zend\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

  • #307 deprecates ServerRequestFactory::normalizeServer(); the method is
    no longer used internally, and users should instead use Zend\Diactoros\normalizeServer(),
    to which it proxies.

  • #307 deprecates ServerRequestFactory::marshalHeaders(); the method is
    no longer used internally, and users should instead use Zend\Diactoros\marshalHeadersFromSapi(),
    to which it proxies.

  • #307 deprecates ServerRequestFactory::marshalUriFromServer(); the method
    is no longer used internally. Users should use marshalUriFromSapi() instead.

  • #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.

  • #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.

  • #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.

  • #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];.

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

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

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

Removed

  • Nothing.

Fixed

  • Nothing.