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

Releases: oscarotero/psr7-middlewares

3.12.2

24 Jan 14:02
Compare
Choose a tag to compare
  • LanguageNegotiator: Added Content-Language header in the response
  • SaveResponse: Executed the nested middlewares before save the response

3.12.1

24 Jan 12:58
Compare
Choose a tag to compare

Fixed a bug in ImageTransformer using paths in sizes names.

3.12.0

22 Jan 19:23
Compare
Choose a tag to compare

New middlewares

Cache

There's some breaking changes in this middleware:

  • The response body is not cached, just the headers, returning a 304 response if the response is not modified.
  • It uses internally micheh/psr7-cache so there's now support for Tags.
  • There's an option to add automatically a Cache-Control header to all responses not having this header.

ImageTransformer

  • Added ImageTransformer::clientHints() option to detect the Client Hints headers
  • Added ImageTransformer::cache() option to save the transformed images in the cache
  • Removed ImageTransformer::basePath() option
  • Allow to limit the sizes to specific directories

LanguageNegotiator

  • New option LanguageNegotiator::usePath() to allow to detect the language in the uri's path (for example: /en/about).
  • New option LanguageNegotiator::redirect() to return redirect response if the language is not in the path (for example: /about => /en/about).
  • New option LanguageNegotiator::basePath() to define a basePath after which is the language.

Other changes

  • Removed Minify::forCache() option
  • Added ReadResponse::appendQuery() option to read filenames with the uri's query
  • Added SaveResponse::appendQuery() option to save files with the uri's query
  • Www::redirect() is set by default to 302

3.11.2

17 Jan 17:44
Compare
Choose a tag to compare

Uuid

  • Upgraded the supported version of Ramsey\Uuid to 3.x (from 2.x) #17

3.11.1

13 Jan 08:38
Compare
Choose a tag to compare

Csrf

  • Allow to set a custom storage in the constructor, instead use $_SESSION
  • Fixed the use of text inputs instead hidden inputs in the html forms.

3.11.0

12 Jan 13:08
Compare
Choose a tag to compare

New middlewares

Api changes

Some middlewares allow set options in two places: using the constructor and methods. For example, the AuraRouter middleware can be configured like this:

//using constructor
Middleware::auraRouter($routerContainer);

//using the method
Middleware::auraRouter()->router($routerContainer);

To simplify the api and remove duplications, a lot of these methods have been removed, so these options must be set only in the constructor. Each constructor does not accept more than one argument and it is:

  • The required option (in middlewares like auraRouter, fastRouter, etc)
  • The optional (but most important option) (DebugBar instance, Whoops instance, "addSlash" option in trainlingSlash, etc)

The rest of optional options are defined with methods.

Other changes

  • Improved BasePath to allow to combine the user defined basepath and the autodetected
  • Improved the output buffer handling to prevent unexpect outputs with throwed exceptions
  • The handler in ErrorHandler is optional
  • The handler in Shutdown is optional
  • Simplified ImageTransformer and remove unsecure features
  • FormTimestamp::key() option is required now.
  • DebugBar changed the way to insert the debugbar. Instead dumping the entire css/js code, now serves the assets files. This avoid 404 error to other assets like fonts.
  • FormatNegotiator Added support to fonts mime types

3.10.2

30 Dec 00:32
Compare
Choose a tag to compare

Debugbar

  • New option captureAjax() to enable/disable the data send in headers in ajax request. #16

3.10.1

29 Dec 18:42
Compare
Choose a tag to compare

Debugbar:

  • The option DebugBar::debugBar() is optional. If it's not passed, creates automatically an instance of DebugBar\StandardDebugBar
  • Fixed the html injection.
  • Make it work with ajax and redirections.

ReadResponse:

  • Use a copy of the stream to not modify the original file accidentally.

GoogleAnalytics:

  • Changed the execution order to be more intuitive. This middleware must be added after the router
  • Fixed the html injection.

Piwik:

  • Changed the execution order to be more intuitive. This middleware must be added after the router
  • Fixed the html injection.

3.10.0

29 Dec 11:11
Compare
Choose a tag to compare

New Middlewares:

Improvements:

  • New BasePath::autodetect() option to detect automatically the base path of the request
  • Allow to retrieve the base path removed using BasePath::getBasePath($request). This is specially useful when the base path is autodetected.
  • New option ClientIp::remote() to get the ip from ipecho. This is usefull for testing in localhost environments.
  • ReadResponse and SaveResponse can read and save gzip encoded responses.
  • ReadResponse can handle ranges.

Other changes

  • Removed ErrorHandler::whoops() option. Use the new Middleware::whoops() instead.
  • The middleware Payload no longer remove the raw content of the body.
  • Changed DebugBar middleware to use http headers in ajax requests
  • Implemented Resolvers and Transformers. This allows to extend easily the library with more transformers (for example, more body parsers, more encoders, minifiers, etc).
  • Removed some options that have be handled by the tranformers:
    • Minify::inlineJs()
    • Minify::inlineCss()
    • Payload::associative()

3.9.3

21 Dec 15:41
Compare
Choose a tag to compare

Fixed basePath() option in imageTranformer