Laminas Diactoros v1.8.0 Release Notes

Release Date: 2018-06-27 // almost 6 years ago
  • โž• 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.