niels-nijens/failurehandling

An error and exception handling library for PHP 5.3+

2.0.0 2014-01-29 19:23 UTC

This package is auto-updated.

Last update: 2024-11-18 02:42:51 UTC


README

An error and exception handling library for PHP 5.3+

Build Status Coverage Status SensioLabsInsight Latest Stable Version

Installation using Composer

Run the following command to add the package to your composer.json:

composer require niels-nijens/failurehandling

This library also requires a PSR-3 compatible logger like niels-nijens/Logging or Monolog for the actual logging of errors and exceptions.

Usage

To activate handling of errors and exceptions, see the following example code.

use Nijens\FailureHandling\FailureCatcher;
use Nijens\FailureHandling\Handlers\DefaultFailureHandler;
use Nijens\Logging\Logger; // Not included in this library

$logger = new Logger(); // Not included in this library

$failureHandler = new DefaultFailureHandler();
$failureHandler->setLogger($logger);

FailureCatcher::start($failureHandler);

About

This is one of the AtomicPHP library series trying to achieve ultimate flexibility for PHP developers through separation of concerns.

Versioning

FailureHandling uses Semantic Versioning 2 as guideline for new versions.

License

FailureHandling is licensed under the MIT License - see the LICENSE file for details.

Author

Niels Nijens - https://github.com/niels-nijens/

Acknowledgements

This library is inspired by an idea about error and exception handling of Giso Stallenberg.