Expressive 1.1.0
This release is primarily intended to introduce deprecations and forwards compatibility features in preparation for a forthcoming 2.0.0 release. Please read the migration document for details.
This release is fully backwards compatible with previous Expressive versions, and will be installed when creating an Expressive project from the existing 1.X series of the Expressive Skeleton.
Added
-
#309 adds the ability to provide options with which to instantiate the
FinalHandlerinstance, via the configuration:[ 'final_handler' => [ 'options' => [ /* array of options */ ], ], -
#373 adds interception of exceptions from the
ServerRequestFactoryfor invalid request information in order to return400responses. -
#432 adds two new configuration flags for use with
Zend\Expressive\Container\ApplicationFactory:zend-expressive.programmatic_pipelines: when enabled, the factory will ignore themiddleware_pipelineandroutesconfiguration, allowing you to wire these programmatically instead. We recommend creating these in the filesconfig/pipeline.phpandconfig/routes.php, respectively, and modifying yourpublic/index.phptorequirethese 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 togetFinalHandler(). -
#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\ApplicationFactoryto vary creation of theApplicationinstance based on two new configuration variables:zend-expressive.programmatic_pipelinewill 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 theApplicationAPI to pipe middleware and/or add routed middleware.zend-expressive.raise_throwableswill cause the factory to call the newraiseThrowables()method exposed byApplication(and inherited fromZend\Stratigility\MiddlewarePipe). Doing so will cause the application to raise anyThrowableorExceptioninstances 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 theraise_throwablesflag 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 providesgetDefaultDelegate()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 throwZend\Expressive\Exception\InvalidArgumentException.Zend\Expressive\Container\Exception\NotFoundException; this exception is never thrown at this point.Zend\Expressive\Container\TemplatedErrorHandlerFactoryZend\Expressive\Container\WhoopsErrorHandlerFactoryZend\Expressive\ErrorMiddlewarePipe; Stratigility 1.3 deprecates itsZend\Stratigility\ErrorMiddlewareInterface, and removes it in version 2.0. use theraise_throwablesflag 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 implementingInterop\Http\ServerMiddleware\DelegateInterfacethat 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
RouteResultSubjectInterfaceimplementation fromZend\Expressive\Application, per the deprecation prior to the 1.0 stable release.
Fixed
- #442 fixes how the
WhoopsFactorydisables JSON output for whoops; previously, providing booleanfalsevalues for either of the configuration flagsjson_exceptions.show_traceorjson_exceptions.ajax_onlywould result in enabling the settings; these flags are now correctly evaluated by theWhoopsFactory.