Expressive v1.1.0 Release Notes

Release Date: 2017-02-13 // about 7 years ago
  • โž• Added

    • #309 adds the ability to provide options with which to instantiate the FinalHandler instance, via the configuration:
      [
          'final_handler' => [
              'options' => [ /* array of options */ ],
          ],
    
    • #373 adds interception of exceptions from the ServerRequestFactory for invalid request information in order to return 400 responses.

    • #432 adds two new configuration flags for use with Zend\Expressive\Container\ApplicationFactory:

      • zend-expressive.programmatic_pipelines: when enabled, the factory will ignore the middleware_pipeline and routes configuration, allowing you to wire these programmatically instead. We recommend creating these in the files config/pipeline.php and config/routes.php, respectively, and modifying your public/index.php to require these files in statements immediately preceding the call to $app->run().
      • zend-expressive.raise_throwables: when enabled, this will be used to notify zend-stratigility's internal dispatcher to no longer catch exceptions/throwables, and instead allow them to bubble out. This allows you to write custom middleware for handling errors.
    • #429 adds Zend\Expressive\Application::getDefaultDelegate() as a forwards-compatibility measure for the upcoming version 2.0.0. Currently, it proxies to getFinalHandler().

    • ๐Ÿ‘ #435 adds support for the 2.X versions of zend-expressive-router and the various router implementations. This change also allows usage of zend-expressive-helpers 3.X.

    ๐Ÿ”„ Changed

    • โšก๏ธ #429 updates the minimum supported zend-stratigility version to 1.3.3.

    • โšก๏ธ #396 updates the Zend\Expressive\Container\ApplicationFactory to vary creation of the Application instance based on two new configuration variables:

      • zend-expressive.programmatic_pipeline will cause the factory to skip injection of the middleware pipeline and routes from configuration. It is then up to the developer to do so, or use the Application API to pipe middleware and/or add routed middleware.
      • zend-expressive.raise_throwables will cause the factory to call the new raiseThrowables() method exposed by Application (and inherited from Zend\Stratigility\MiddlewarePipe). Doing so will cause the application to raise any Throwable or Exception instances caught, instead of catching them and dispatching them to (legacy) Stratigility error middleware.

    ๐Ÿ—„ Deprecated

    • ๐Ÿ—„ #429 deprecates the following methods and classes:
      • Zend\Expressive\Application::pipeErrorHandler(); use the raise_throwables flag and standard middleware to handle errors instead.
      • Zend\Expressive\Application::routeMiddleware(); this is extracted to a dedicated middleware class for 2.0.
      • Zend\Expressive\Application::dispatchMiddleware(); this is extracted to a dedicated middleware class for 2.0.
      • Zend\Expressive\Application::getFinalHandler() (this patch provides getDefaultDelegate() as a forwards-compatibility measure)
      • Zend\Expressive\Container\Exception\InvalidArgumentException; this will be removed in 2.0.0, and places where it was used will instead throw Zend\Expressive\Exception\InvalidArgumentException.
      • Zend\Expressive\Container\Exception\NotFoundException; this exception is never thrown at this point.
      • Zend\Expressive\Container\TemplatedErrorHandlerFactory
      • Zend\Expressive\Container\WhoopsErrorHandlerFactory
      • Zend\Expressive\ErrorMiddlewarePipe; Stratigility 1.3 deprecates its Zend\Stratigility\ErrorMiddlewareInterface, and removes it in version 2.0. use the raise_throwables flag and standard middleware to handle errors instead.
      • Zend\Expressive\TemplatedErrorHandler; the "final handler" concept is retired in Expressive 2.0, and replaced with default delegates (classes implementing Interop\Http\ServerMiddleware\DelegateInterface that will be executed when the internal pipeline is exhausted, in order to guarantee a response). If you are using custom final handlers, you will need to rewrite them when adopting Expressive 2.0.
      • Zend\Expressive\WhoopsErrorHandler

    โœ‚ Removed

    • ๐Ÿšš #406 removes the RouteResultSubjectInterface implementation from Zend\Expressive\Application, per the deprecation prior to the 1.0 stable release.

    ๐Ÿ›  Fixed

    • ๐Ÿ›  #442 fixes how the WhoopsFactory disables JSON output for whoops; previously, providing boolean false values for either of the configuration flags json_exceptions.show_trace or json_exceptions.ajax_only would result in enabling the settings; these flags are now correctly evaluated by the WhoopsFactory.