jinnguyen / puja-error
Puja-Error are the handler layers, that handle all fatal exceptions/errors ( include fatal errors) from PHP application. Support callback function
Installs: 43
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/jinnguyen/puja-error
Requires
This package is not auto-updated.
Last update: 2025-10-06 20:04:25 UTC
README
Puja-Error are the handler layers, that handle all errors/exceptions for PHP application.
Install
composer require jinnguyen/puja-error
Usage
include '/path/to/vendor/autoload.php'; use Puja\Error\ErrorManager;
Examples
class A { public function b(array $erroMessage = array()) { print_r($erroMessage); // viewsource to see how this function work } } use Puja\Error\ErrorManager; new ErrorManager(array( 'enabled' => true, // toggle on/off Error Manager 'debug' => true, // toggle on/off mode DEBUG 'error_level' => E_ALL, // same with error_reporting() 'callback_fn' => array(new A(), 'b')) // callback function, will call after application get error (you can do some stuff like: log errors, roll back db transaction, ...) ); $a = new A(); $a->c();