dev-master
9999999-devA really simple class that can report fata errors by mail
MIT
The Development Requires
by Philipp Scheit
1.0.2
1.0.2.0A really simple class that can report fata errors by mail
MIT
The Development Requires
by Philipp Scheit
Wallogit.com
2017 © Pedro Peláez
A really simple class that can report fata errors by mail
A really simple class that can report fata errors by mail, (*1)
Use Composer to install., (*2)
composer require -v --prefer-source webforge/fatal-error-handler @stable
// do vendor autoload
$handler = new \Webforge\FatalErrorHandler('yourmail@your-domain.com');
$handler->register();
Fatal errors coming after these lines will be tried to be mailed with mail(). If mail() fails a notice is written into the php error log, (*3)
Its now possible to add a custom callback to replace the php mail() call with your own logic to send the mail. Test your callback really really well!, (*4)
// do vendor autoload
$handler = new \Webforge\FatalErrorHandler('yourmail@your-domain.com', function($recipient, $subject, $text, $headersString) {
// send your own mail here, or log, etc
return $successOfMail;
});
$handler->register();
the header string is already encoded for the php mail() function. (full string with \r\n seperated headers);, (*5)
A really simple class that can report fata errors by mail
MIT
A really simple class that can report fata errors by mail
MIT