geoffroy-aubry/errorhandler
最新稳定版本:v1.3.1
Composer 安装命令:
composer require geoffroy-aubry/errorhandler
包简介
Error and exception handler
README 文档
README
Simple error and exception handler:
- converts error to an
ErrorExceptioninstance according to error reporting level - when running the
PHP CLI, reports errors/exceptions toSTDERR(even fatal error) and uses exception code as exit status - allows to deactivate
@operator - catches fatal error
- accepts callback to be executed at the end of the internal shutdown function
- accepts callback to display an apology when errors are hidden
- allows to ignore errors on some paths, useful with old libraries and deprecated code…
Installation
-
Class autoloading and dependencies are managed by Composer so install it following the instructions on Composer: Installation - *nix or just run the following command:
$ curl -sS https://getcomposer.org/installer | php -
Add dependency to
GAubry\ErrorHandlerinto require section of yourcomposer.json:{ "require": { "geoffroy-aubry/errorhandler": "1.*" } }and run
php composer.phar installfrom the terminal into the root folder of your project. -
Include Composer's autoloader:
<?php require_once 'vendor/autoload.php'; …
Usage
-
Basic usage, in your bootstrap:
<?php use GAubry\ErrorHandler\ErrorHandler; $aConfig = array( 'display_errors' => true, 'error_log_path' => '/var/log/xyz.log', 'error_reporting_level' => -1, 'auth_error_suppr_op' => false ); new ErrorHandler($aConfig); …
-
Ignore errors on some paths, useful with old libraries and deprecated code:
$oErrorHandler = new ErrorHandler($aConfig); $oErrorHandler->addExcludedPath('[CouchbaseNative]', true);
Documentation
API documentation
is generated by ApiGen in the doc/api folder.
$ php vendor/bin/apigen -c apigen.neon
Copyrights & licensing
Licensed under the GNU Lesser General Public License v3 (LGPL version 3). See LICENSE file for details.
Change log
See CHANGELOG file for details.
Continuous integration
Following commands are executed during each build and must report neither errors nor warnings:
-
Unit tests with PHPUnit:
$ php vendor/bin/phpunit --configuration phpunit.xml
-
Coding standards with PHP CodeSniffer:
$ php vendor/bin/phpcs --standard=PSR2 src/ tests/ -v
-
Code quality with PHP Mess Detector:
$ php vendor/bin/phpmd src/ text codesize,design,unusedcode,naming,controversial
Git branching model
The git branching model used for development is the one described and assisted by twgit tool: https://github.com/Twenga/twgit.
统计信息
- 总下载量: 3.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2013-06-04