softius/exceptionist 问题修复 & 功能扩展

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

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

softius/exceptionist

最新稳定版本:0.3

Composer 安装命令:

composer require softius/exceptionist

包简介

Exception handler for PHP 5.3

README 文档

README

Exceptionist provides exception handler for PHP 5.3+. Based on the application environment you can choose to display a detailed error report with stack trace or a mini report just mentioning the exception occured.

Installation

Exceptionist is available on packagist. All you need is to add the following lines in your project composer.json:

	{
    	"require": {
        	"softius/exceptionist": "0.1"
	    }
	}

and install via composer:

	php composer.phar install

Then, you will need to setup GenericExceptionHandler. You are adviced to setup the following as early as possible in your script.

set_exception_handler(array(new \Exceptionist\GenericExceptionHandler(array('project_root' => 'project_root_dir')), 'handle'));	

Configuration

GenericExceptionHandler accepts a configuration array with the following options:

  • project_root: defines the project root directory, default is null.
  • template_script: full path of the template to be used. The following built-in templates are available: \Exceptionist\ExceptionReporter::TEMPLATE_DETAILED
  • code_block_length: number of lines to be displayed in each code block, default is 10.

How it works

ExceptionHandler is using ExceptionReporter class to generate and display exception reports. This happens only and only if an exception is thrown and not caught within a try/catch block. Templates are available in templates which can be copied, modified and adjusted to your needs, if necessary.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-02-21