niels-nijens / failurehandling
An error and exception handling library for PHP 5.3+
Requires
- php: >=5.3.3
- niels-nijens/utilities: ~2.0
- psr/log: 1.0.*
Requires (Dev)
- phpunit/phpunit: 3.7.*
- satooshi/php-coveralls: dev-master
Suggests
- niels-nijens/logging: The recommended logging library to use with FailureHandling.
This package is auto-updated.
Last update: 2024-10-18 02:32:43 UTC
README
An error and exception handling library for PHP 5.3+
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.