@weierophinney weierophinney released this Jul 24, 2018 · 2 commits to master since this release

Assets 2

Added

  • Nothing.

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • #177 removes a conditional from Zend\Stratigility\Middleware\ErrorHandler that can
    never be reached.

Fixed

  • Nothing.

@weierophinney weierophinney released this Apr 16, 2018 · 213 commits to master since this release

Assets 2

Added

  • Nothing.

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • #169 fixes an issue with how the PathMiddlewareDecorator attempts to truncate the path
    when the path is matched case insensitively. Previously, an exception was incorrectly raised;
    now it identifies and truncates correctly.

@weierophinney weierophinney released this Apr 4, 2018 · 14 commits to master since this release

Assets 2

Added

  • Nothing.

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

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

@weierophinney weierophinney released this Apr 4, 2018 · 213 commits to master since this release

Assets 2

Added

  • Nothing.

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

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

@weierophinney weierophinney released this Mar 15, 2018 · 32 commits to master since this release

Assets 2

Added

  • #146 adds a new interface, Zend\Stratigility\MiddlewarePipeInterface. It extends the PSR-15 MiddlewareInterface and RequestHandlerInterface, and defines one additional method, pipe(MiddlewareInterface $middleware) : void.

  • #150 adds a new class, Zend\Stratigility\Middleware\RequestHandlerMiddleware. The class implements the PSR-15 RequestHandlerInterface and MiddlewareInterface, and accepts a single constructor argument, a RequestHandlerInterface instance. Each of its handle() and process() methods proxy to the composed request handler's handle() method, returning its result.

    This class can be useful for adapting request handlers to use within pipelines.

  • #142 adds a new class, Zend\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, Zend\Stratigility\host(), to simplify the above declaration:

    $pipeline->pipe(host('example.com', $middleware));
  • #128 adds a marker interface, Zend\Stratigility\Exception\ExceptionInterface; all package exceptions now implement this interface, allowing you to catch all package-related exceptions by typehinting against it.

Changed

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

  • #134 and #146 modify MiddlewarePipe in two ways: it now implements the new MiddlewarePipeInterface, and is marked as final, disallowing direct extension. Either decorate an instance in a custom MiddlewarePipeInterface implementation, or create a custom PSR-15 MiddlewareInterface implementation if piping is not necessary or will allow additional types.

  • #155 modifies each of the following classes to mark them final:

    • Zend\Stratigility\Middleware\CallableMiddlewareDecorator
    • Zend\Stratigility\Middleware\DoublePassMiddlewareDecorator
    • Zend\Stratigility\Middleware\HostMiddlewareDecorator
    • Zend\Stratigility\Middleware\NotFoundHandler
    • Zend\Stratigility\Middleware\OriginalMessages
    • Zend\Stratigility\Middleware\PathMiddlewareDecorator
    • Zend\Stratigility\Middleware\RequestHandlerMiddleware
    • Zend\Stratigility\Next
  • #134, #145, and #146 update MiddlewarePipe to implement Psr\Http\Server\RequestHandlerInterface. Calling it will cause it to pull the first middleware off the queue and create a Next implementation that uses the remaining queue as the request handler; it then processes the middleware.

  • #134 removes the ability to specify a path when calling pipe(); use the PathMiddlewareDecorator or path() utility function to pipe middleware with path segregation.

  • #153 modifies the first argument of the Zend\Expressive\Middleware\ErrorHandler and NotFoundHandler classes. Previously, they each expected a Psr\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.

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

  • #163 removes Zend\Stratigility\Middleware\PathRequestHandlerDecorator, as it was deprecated in 2.2, and no longer used with the 3.0 code base.

  • #122 removes support for PHP versions 5.6, 7.0, as well as HHVM.

  • #122 removes the following classes:

    • Zend\Stratigility\Delegate\CallableDelegateDecorator
    • Zend\Stratigility\Exception\InvalidRequestTypeException
    • Zend\Stratigility\Exception\MissingResponsePrototypeException
    • Zend\Stratigility\MiddlewareInterface
    • Zend\Stratigility\Middleware\CallableInteropMiddlewareWrapper
    • Zend\Stratigility\Middleware\CallableMiddlewareWrapper
    • Zend\Stratigility\Middleware\CallableMiddlewareWrapperFactory
    • Zend\Stratigility\NoopFinalHandler
  • #134 removes the class Zend\Stratigility\Route. This was an internal message passed between a MiddlewarePipe and Next instance, and its removal should not affect end users.

  • #134 removes Zend\Stratigility\Exception\InvalidMiddlewareException, as the exception is no longer raised by MiddlewarePipe.

Fixed

  • Nothing.

@weierophinney weierophinney released this Mar 12, 2018 · 213 commits to master since this release

Assets 2

Added

  • #140 adds the class Zend\Stratigility\Middleware\CallableMiddlewareDecorator for the purpose of decorating callable, standards-signature middleware for use with a MiddlewarePipe instance. Instantiate it directly, passing the callable middleware as the sole argument, or use the Zend\Stratigility\middleware() utility function to generate the instance: middleware($callable).

  • #140 adds the class Zend\Stratigility\Middleware\DoublePassMiddlewareDecorator for the purpose of decorating callable, double-pass middleware for use with a MiddlewarePipe instance. Instantiate it directly, passing the callable middleware and a response instance as arguments, or use the Zend\Stratigility\doublePassMiddleware() utility function to generate the instance: doublePassMiddleware($callable, $response).

  • #140 adds the class Zend\Stratigility\Middleware\PathMiddlewareDecorator for the purposes of creating path-segregated middleware. The constructor expects a string path literal as the first argument, and an Interop\Http\Server\MiddlewareInterface instance for the second argument. Alternately, use the Zend\Stratigility\path() utility function to generate the instance: path('/foo', $middleware).

    This decorator class replaces usage of the $path argument to MiddlewarePipe::pipe(), and should be used to ensure your application is forwards-compatible with the upcoming version 3 release.

Changed

  • Nothing.

Deprecated

  • #140 deprecates the class Zend\Stratigility\Route. This class is an internal detail, and will be removed in version 3.0.0.

  • #140 deprecates the class Zend\Stratigility\Exception\InvalidMiddlewareException. This class will be removed in version 3.0.0 as it will no longer be necessary due to typehint usage.

  • #140 deprecates the class Zend\Stratigility\Exception\InvalidRequestTypeException as it is no longer used by the package. It will be removed in version 3.0.0.

  • #140 deprecates the class Zend\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 class Zend\Stratigility\Middleware\CallableMiddlewareDecorator, or the utility function middleware(), to decorate callable standards-signature middleware.

  • #140 deprecates the class Zend\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 class Zend\Stratigility\Middleware\DoublePassMiddlewareDecorator, or the utility function doublePassMiddleware(), to decorate callable double pass middleware.

  • #140 deprecates the class Zend\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.

  • #140 deprecates the class Zend\Stratigility\NoopFinalHandler as the class will be removed starting in version 3.0.0.

  • #140 deprecates the two-argument form of Zend\Stratigility\MiddlewarePipe::pipe(). If you need to perform path segregation, use the Zend\Stratigility\Middleware\PathMiddlewareDecorator class and/or the Zend\Stratigility\path() function to decorate your middleware in order to provide path segregation.

  • #140 deprecates the piping of double pass middleware directly to pipe(); decorate your double-pass middleware using Zend\Stratigility\Middleware\DoublePassMiddleware or Zend\Stratigility\doublePassMiddleware() prior to piping.

  • #159 deprecates Zend\Stratigility\MiddlewarePipe::setCallableMiddlewareDecorator(). Use Zend\Stratigility\doublePassMiddleware() or Zend\Stratigility\Middleware\DoublePassMiddleware prior to passing your double-pass middleware to MiddlewarePipe::pipe().

  • #159 deprecates Zend\Stratigility\MiddlewarePipe::setResponsePrototype(). This was used only to seed an instance of Zend\Stratigility\Middleware\CallableMiddlewareWrapperFactory previously; pass your response prototype directly to a new instance of Zend\Stratigility\Middleware\DoublePassMiddleware or the ``Zend\Stratigility\doublePassMiddleware()` function instead.

  • #159 deprecates Zend\Stratigility\MiddlewarePipe::hasResponsePrototype().

Removed

  • Nothing.

Fixed

  • Nothing.

@weierophinney weierophinney released this Mar 8, 2018 · 219 commits to master since this release

Assets 2

Added

  • Nothing.

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • Fixes the signature of PathRequestHandlerDecorator::process() to typehint against the PSR-7 ServerRequestInterface, and not RequestInterface.

@weierophinney weierophinney released this Mar 8, 2018 · 221 commits to master since this release

Assets 2

Added

  • Nothing.

Changed

  • Nothing.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • #160 fixes the implementation of PathRequestHandlerDecorator to implement the process() method, which is defined in the DelegateInterface of http-interop 0.4.1. Without this patch, the class would not work with that version of http-interop.

@weierophinney weierophinney released this Mar 6, 2018 · 224 commits to master since this release

Assets 2

Added

  • #140 adds the class Zend\Stratigility\Middleware\CallableMiddlewareDecorator for the purpose of decorating callable, standards-signature middleware for use with a MiddlewarePipe instance. Instantiate it directly, passing the callable middleware as the sole argument, or use the Zend\Stratigility\middleware() utility function to generate the instance: middleware($callable).

  • #140 adds the class Zend\Stratigility\Middleware\DoublePassMiddlewareDecorator for the purpose of decorating callable, double-pass middleware for use with a MiddlewarePipe instance. Instantiate it directly, passing the callable middleware and a response instance as arguments, or use the Zend\Stratigility\doublePassMiddleware() utility function to generate the instance: doublePassMiddleware($callable, $response).

  • #140 adds the class Zend\Stratigility\Middleware\PathMiddlewareDecorator for the purposes of creating path-segregated middleware. The constructor expects a string path literal as the first argument, and an Interop\Http\Server\MiddlewareInterface instance for the second argument. Alternately, use the Zend\Stratigility\path() utility function to generate the instance: path('/foo', $middleware).

    This decorator class replaces usage of the $path argument to MiddlewarePipe::pipe(), and should be used to ensure your application is forwards-compatible with the upcoming version 3 release.

Changed

  • Nothing.

Deprecated

  • #140 deprecates the class Zend\Stratigility\Route. This class is an internal detail, and will be removed in version 3.0.0.

  • #140 deprecates the class Zend\Stratigility\Exception\InvalidMiddlewareException. This class will be removed in version 3.0.0 as it will no longer be necessary due to typehint usage.

  • #140 deprecates the class Zend\Stratigility\Exception\InvalidRequestTypeException as it is no longer used by the package. It will be removed in version 3.0.0.

  • #140 deprecates the class Zend\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 class Zend\Stratigility\Middleware\CallableMiddlewareDecorator, or the utility function middleware(), to decorate callable standards-signature middleware.

  • #140 deprecates the class Zend\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 class Zend\Stratigility\Middleware\DoublePassMiddlewareDecorator, or the utility function doublePassMiddleware(), to decorate callable double pass middleware.

  • #140 deprecates the class Zend\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.

  • #140 deprecates the class Zend\Stratigility\NoopFinalHandler as the class will be removed starting in version 3.0.0.

  • #140 deprecates the two-argument form of Zend\Stratigility\MiddlewarePipe::pipe(). If you need to perform path segregation, use the Zend\Stratigility\Middleware\PathMiddlewareDecorator class and/or the Zend\Stratigility\path() function to decorate your middleware in order to provide path segregation.

  • #140 deprecates the piping of double pass middleware directly to pipe(); decorate your double-pass middleware using Zend\Stratigility\Middleware\DoublePassMiddleware or Zend\Stratigility\doublePassMiddleware() prior to piping.

  • #159 deprecates Zend\Stratigility\MiddlewarePipe::setCallableMiddlewareDecorator(). Use Zend\Stratigility\doublePassMiddleware() or Zend\Stratigility\Middleware\DoublePassMiddleware prior to passing your double-pass middleware to MiddlewarePipe::pipe().

  • #159 deprecates Zend\Stratigility\MiddlewarePipe::setResponsePrototype(). This was used only to seed an instance of Zend\Stratigility\Middleware\CallableMiddlewareWrapperFactory previously; pass your response prototype directly to a new instance of Zend\Stratigility\Middleware\DoublePassMiddleware or the ``Zend\Stratigility\doublePassMiddleware()` function instead.

  • #159 deprecates Zend\Stratigility\MiddlewarePipe::hasResponsePrototype().

Removed

  • Nothing.

Fixed

  • Nothing.

@weierophinney weierophinney released this Feb 26, 2018 · 91 commits to master since this release

Assets 2

Added

  • Nothing.

Changed

  • #155 modifies each of the following classes to mark them final:

    • Zend\Stratigility\Middleware\CallableMiddlewareDecorator
    • Zend\Stratigility\Middleware\DoublePassMiddlewareDecorator
    • Zend\Stratigility\Middleware\HostMiddlewareDecorator
    • Zend\Stratigility\Middleware\NotFoundHandler
    • Zend\Stratigility\Middleware\OriginalMessages
    • Zend\Stratigility\Middleware\PathMiddlewareDecorator
    • Zend\Stratigility\Middleware\RequestHandlerMiddleware
    • Zend\Stratigility\Next
  • #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

  • Nothing.

Fixed

  • Nothing.