componenta/error-handler-app
Composer 安装命令:
composer require componenta/error-handler-app
包简介
Componenta application integration for error handling and reporting
README 文档
README
Application integration for Componenta error handling. The package registers debug-aware renderers and file/HTML logging listeners used by the base componenta/error-handler services.
The base error contracts, contexts, handlers, renderers, middleware, and response generators live in componenta/error-handler. This package wires them into a Componenta application through Componenta\Error\App\ConfigProvider.
Installation
composer require componenta/error-handler-app
The package exposes Componenta\Error\App\ConfigProvider through Composer metadata.
Debug Behavior
APP_DEBUG=true controls whether the HTTP renderer shows detailed exception output. When debug is disabled, the application renderer uses the safe templates/error/500.phtml template through Componenta\Error\Renderer\SafeRenderer.
Debug is resolved directly from the environment file by Componenta\Error\App\EnvDebugResolver, so the decision does not depend on already-built application configuration.
Values 1, true, yes, and on enable debug. Missing .env, missing APP_DEBUG, and any other value disable debug.
Logging
Componenta\Error\App\Listener\FileLogListener writes text logs. Componenta\Error\App\Listener\HtmlLogListener writes HTML snapshots for browser inspection. Paths are resolved through componenta/path-resolver.
FileLogListener is registered for HTTP and CLI errors. HtmlLogListener is registered only for HTTP errors and writes snapshots only when APP_DEBUG is enabled.
Registered Services
Componenta\Error\App\ConfigProvider configures:
| Key or service | Value |
|---|---|
ErrorConfigKey::HTTP_LISTENERS |
FileLogListener, HtmlLogListener |
ErrorConfigKey::CLI_LISTENERS |
FileLogListener |
ErrorConfigKey::HTTP_RENDERER |
PrettyPageRenderer(debug: true) in debug, otherwise SafeRenderer with templates/error/500.phtml. |
ErrorConfigKey::CLI_RENDERER |
PlainTextRenderer with debug flag from .env. |
SafeRenderer::class |
Safe renderer bound to templates/error/500.phtml. |
This package does not replace the base handlers from componenta/error-handler; it only supplies application renderers and listeners used by those handlers.
Related Packages
componenta/error-handlerdefines the core error handling contracts and runtime handlers.componenta/http-emitteremits HTTP responses.componenta/skeletonshows how application entry points log bootstrap failures and render the safe 500 template for HTTP flows.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-14