Changelog History
Page 2
-
v3.0.2.p2
March 23, 2020 -
v3.0.1 Changes
April 04, 2018โ Added
- Nothing.
๐ Changed
- Nothing.
๐ Deprecated
- Nothing.
โ Removed
- Nothing.
๐ Fixed
- ๐ zendframework/zend-stratigility#165 fixes an
issue with the
PathMiddlewareDecorator
whereby it was using the original request when invoking the handler it creates, instead of prepending the configured path prefix to the request URI created. With the fix, if middleware alters the request path passed to the handler, the changes will now propagate to later middleware. As an example:
new PathMiddlewareDecorator('/api', middleware(function ($request, $handler) { $uri = $request->getUri(); if (! preg_match('#^/v\d+/#', $uri->getPath())) { $request = $request->withUri($uri->withPath('/v1' . $uri->getPath())); } return $handler->handle($request); }));
For the request path
/api/books
, the above will now correctly result in/api/v1/books
being propagated to lower layers of the application, instead of/api/books
. -
v3.0.1.p2
March 23, 2020 -
v3.0.0 Changes
March 15, 2018โ Added
zendframework/zend-stratigility#146 adds a new interface,
Laminas\Stratigility\MiddlewarePipeInterface
. It extends the PSR-15MiddlewareInterface
andRequestHandlerInterface
, and defines one additional method,pipe(MiddlewareInterface $middleware) : void
.zendframework/zend-stratigility#150 adds a new class,
Laminas\Stratigility\Middleware\RequestHandlerMiddleware
. The class implements the PSR-15RequestHandlerInterface
andMiddlewareInterface
, and accepts a single constructor argument, aRequestHandlerInterface
instance. Each of itshandle()
andprocess()
methods proxy to the composed request handler'shandle()
method, returning its result.
This class can be useful for adapting request handlers to use within pipelines.
- zendframework/zend-stratigility#142 adds a new
class,
Laminas\Stratigility\Middleware\HostMiddlewareDecorator
, which provides host segregation functionality for middleware, allowing conditional execution of middleware only if the requested host matches a configured host.
// Only process $middleware if the request host matches 'example.com': $pipeline->pipe(new HostMiddlewareDecorator('example.com', $middleware));
Additionally, the patch provides a utility function,
Laminas\Stratigility\host()
, to simplify the above declaration:$pipeline->pipe(host('example.com', $middleware));
- zendframework/zend-stratigility#128 adds a
marker interface,
Laminas\Stratigility\Exception\ExceptionInterface
; all package exceptions now implement this interface, allowing you to catch all package-related exceptions by typehinting against it.
๐ Changed
โก๏ธ zendframework/zend-stratigility#145 updates the component to implement and consume ONLY PSR-15 interfaces; http-interop interfaces and callable middleware are no longer directly supported (though Stratigility provides decorators for the latter in order to cast them to PSR-15 implementations).
zendframework/zend-stratigility#134 and zendframework/zend-stratigility#146 modify
MiddlewarePipe
in two ways: it now implements the newMiddlewarePipeInterface
, and is marked asfinal
, disallowing direct extension. Either decorate an instance in a customMiddlewarePipeInterface
implementation, or create a custom PSR-15MiddlewareInterface
implementation if piping is not necessary or will allow additional types.zendframework/zend-stratigility#155 modifies each of the following classes to mark them
final
:Laminas\Stratigility\Middleware\CallableMiddlewareDecorator
Laminas\Stratigility\Middleware\DoublePassMiddlewareDecorator
Laminas\Stratigility\Middleware\HostMiddlewareDecorator
Laminas\Stratigility\Middleware\NotFoundHandler
Laminas\Stratigility\Middleware\OriginalMessages
Laminas\Stratigility\Middleware\PathMiddlewareDecorator
Laminas\Stratigility\Middleware\RequestHandlerMiddleware
Laminas\Stratigility\Next
zendframework/zend-stratigility#134, zendframework/zend-stratigility#145, and zendframework/zend-stratigility#146 update
MiddlewarePipe
to implementPsr\Http\Server\RequestHandlerInterface
. Calling it will cause it to pull the first middleware off the queue and create aNext
implementation that uses the remaining queue as the request handler; it then processes the middleware.๐ zendframework/zend-stratigility#134 removes the ability to specify a path when calling
pipe()
; use thePathMiddlewareDecorator
orpath()
utility function to pipe middleware with path segregation.zendframework/zend-stratigility#153 modifies the first argument of the
Mezzio\Middleware\ErrorHandler
andNotFoundHandler
classes. Previously, they each expected aPsr\Http\Message\ResponseInterface
instance; they now both expect a PHP callable capable of producing such an instance. This change was done to simplify re-use of a service for producing unique response instances within dependency injection containers.zendframework/zend-stratigility#157 marks the package as conflicting with zendframework/zend-diactoros versions less than 1.7.1. This is due to the fact that that version provides a bugfix for its
Uri::getHost()
implementation that ensures it follows the PSR-7 and IETF RFC 3986 specifications.
๐ Deprecated
- Nothing.
โ Removed
๐ zendframework/zend-stratigility#163 removes
Laminas\Stratigility\Middleware\PathRequestHandlerDecorator
, as it was deprecated in 2.2, and no longer used with the 3.0 code base.๐ zendframework/zend-stratigility#122 removes support for PHP versions 5.6, 7.0, as well as HHVM.
๐ zendframework/zend-stratigility#122 removes the following classes:
Laminas\Stratigility\Delegate\CallableDelegateDecorator
Laminas\Stratigility\Exception\InvalidRequestTypeException
Laminas\Stratigility\Exception\MissingResponsePrototypeException
Laminas\Stratigility\MiddlewareInterface
Laminas\Stratigility\Middleware\CallableInteropMiddlewareWrapper
Laminas\Stratigility\Middleware\CallableMiddlewareWrapper
Laminas\Stratigility\Middleware\CallableMiddlewareWrapperFactory
Laminas\Stratigility\NoopFinalHandler
๐ zendframework/zend-stratigility#134 removes the class
Laminas\Stratigility\Route
. This was an internal message passed between aMiddlewarePipe
andNext
instance, and its removal should not affect end users.๐ zendframework/zend-stratigility#134 removes
Laminas\Stratigility\Exception\InvalidMiddlewareException
, as the exception is no longer raised byMiddlewarePipe
.
๐ Fixed
- Nothing.
-
v3.0.0.p2
March 23, 2020 -
v2.2.2.p2
March 23, 2020 -
v2.2.1.p2
March 23, 2020 -
v2.2.0 Changes
March 12, 2018โ Added
zendframework/zend-stratigility#140 adds the class
Laminas\Stratigility\Middleware\CallableMiddlewareDecorator
for the purpose of decorating callable, standards-signature middleware for use with aMiddlewarePipe
instance. Instantiate it directly, passing the callable middleware as the sole argument, or use theLaminas\Stratigility\middleware()
utility function to generate the instance:middleware($callable)
.zendframework/zend-stratigility#140 adds the class
Laminas\Stratigility\Middleware\DoublePassMiddlewareDecorator
for the purpose of decorating callable, double-pass middleware for use with aMiddlewarePipe
instance. Instantiate it directly, passing the callable middleware and a response instance as arguments, or use theLaminas\Stratigility\doublePassMiddleware()
utility function to generate the instance:doublePassMiddleware($callable, $response)
.zendframework/zend-stratigility#140 adds the class
Laminas\Stratigility\Middleware\PathMiddlewareDecorator
for the purposes of creating path-segregated middleware. The constructor expects a string path literal as the first argument, and anInterop\Http\Server\MiddlewareInterface
instance for the second argument. Alternately, use theLaminas\Stratigility\path()
utility function to generate the instance:path('/foo', $middleware)
.
This decorator class replaces usage of the
$path
argument toMiddlewarePipe::pipe()
, and should be used to ensure your application is forwards-compatible with the upcoming version 3 release.๐ Changed
- Nothing.
๐ Deprecated
๐ zendframework/zend-stratigility#140 deprecates the class
Laminas\Stratigility\Route
. This class is an internal detail, and will be removed in version 3.0.0.๐ zendframework/zend-stratigility#140 deprecates the class
Laminas\Stratigility\Exception\InvalidMiddlewareException
. This class will be removed in version 3.0.0 as it will no longer be necessary due to typehint usage.๐ zendframework/zend-stratigility#140 deprecates the class
Laminas\Stratigility\Exception\InvalidRequestTypeException
as it is no longer used by the package. It will be removed in version 3.0.0.๐ zendframework/zend-stratigility#140 deprecates the class
Laminas\Stratigility\Middleware\CallableInteropMiddlewareWrapper
as it is based on interfaces that will no longer be used starting in version 3.0.0. It will be removed in version 3.0.0. Please use the new classLaminas\Stratigility\Middleware\CallableMiddlewareDecorator
, or the utility functionmiddleware()
, to decorate callable standards-signature middleware.๐ zendframework/zend-stratigility#140 deprecates the class
Laminas\Stratigility\Middleware\CallableMiddlewareWrapper
as it is based on interfaces that will no longer be used starting in version 3.0.0. It will be removed in version 3.0.0. Please use the new classLaminas\Stratigility\Middleware\DoublePassMiddlewareDecorator
, or the utility functiondoublePassMiddleware()
, to decorate callable double pass middleware.๐ zendframework/zend-stratigility#140 deprecates the class
Laminas\Stratigility\Middleware\CallableMiddlewareWrapperFactory
as the class it is associated will be removed starting in version 3.0.0. The class will be removed in version 3.0.0.๐ zendframework/zend-stratigility#140 deprecates the class
Laminas\Stratigility\NoopFinalHandler
as the class will be removed starting in version 3.0.0.๐ zendframework/zend-stratigility#140 deprecates the two-argument form of
Laminas\Stratigility\MiddlewarePipe::pipe()
. If you need to perform path segregation, use theLaminas\Stratigility\Middleware\PathMiddlewareDecorator
class and/or theLaminas\Stratigility\path()
function to decorate your middleware in order to provide path segregation.๐ zendframework/zend-stratigility#140 deprecates the piping of double pass middleware directly to
pipe()
; decorate your double-pass middleware usingLaminas\Stratigility\Middleware\DoublePassMiddleware
orLaminas\Stratigility\doublePassMiddleware()
prior to piping.๐ zendframework/zend-stratigility#159 deprecates
Laminas\Stratigility\MiddlewarePipe::setCallableMiddlewareDecorator()
. UseLaminas\Stratigility\doublePassMiddleware()
orLaminas\Stratigility\Middleware\DoublePassMiddleware
prior to passing your double-pass middleware toMiddlewarePipe::pipe()
.๐ zendframework/zend-stratigility#159 deprecates
Laminas\Stratigility\MiddlewarePipe::setResponsePrototype()
. This was used only to seed an instance ofLaminas\Stratigility\Middleware\CallableMiddlewareWrapperFactory
previously; pass your response prototype directly to a new instance ofLaminas\Stratigility\Middleware\DoublePassMiddleware
or the `Laminas\Stratigility\doublePassMiddleware()
function instead.๐ zendframework/zend-stratigility#159 deprecates
Laminas\Stratigility\MiddlewarePipe::hasResponsePrototype()
.
โ Removed
- Nothing.
๐ Fixed
- Nothing.
-
v2.2.0.p2
March 23, 2020 -
v2.1.2 Changes
October 12, 2017โ Added
- Nothing.
๐ Changed
- Nothing.
๐ Deprecated
- Nothing.
โ Removed
- Nothing.
๐ Fixed
- โก๏ธ zendframework/zend-stratigility#119 updates to
webimpress/http-middleware-compatibility
^0.1.3
. This was done to ensure backwards compatibilty by injecting the projectcomposer.json
with the currently installed version of http-interop/http-middleware, and in cases where that package is not yet installed, prompting the user to install it. This approach provides a tiered migration path to http-middleware 0.5.0 for users.