PHP Class Zend\Expressive\Container\WhoopsErrorHandlerFactory

Register this factory as the service Zend\Expressive\FinalHandler in the container of your choice. This factory has optional dependencies on the following services: - 'Zend\Expressive\Template\TemplateRendererInterface', which should return an implementation of that interface. If not present, the error handler will not create templated responses. - 'config' (which should return an array or array-like object with a "zend-expressive" top-level key, and an "error_handler" subkey, containing the configuration for the error handler). This factory has required dependencies on the following services: - Zend\Expressive\Whoops, which should return a Whoops\Run instance. - Zend\Expressive\WhoopsPageHandler, which should return a Whoops\Handler\PrettyPageHandler instance. Configuration should look like the following: 'zend-expressive' => [ 'error_handler' => [ 'template_404' => 'name of 404 template', 'template_error' => 'name of error template', ], ] If any of the keys are missing, default values will be used. The whoops configuration can contain: 'whoops' => [ 'json_exceptions' => [ 'display' => true, 'show_trace' => true, 'ajax_only' => true, ] ] All values are booleans; omission of any implies boolean false.
ファイルを表示 Open project: zendframework/zend-expressive

Public Methods

Method Description
__invoke ( Interop\Container\ContainerInterface $container )

Private Methods

Method Description
registerJsonHandler ( Whoops\Run $whoops, array | ArrayAccess $config ) If configuration indicates a JsonResponseHandler, configure and register it.

Method Details

__invoke() public method

public __invoke ( Interop\Container\ContainerInterface $container )
$container Interop\Container\ContainerInterface