componenta/error-handler-app 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固