2017 © Pedro Peláez
 

library fatal-error-handler

A really simple class that can report fata errors by mail

image

webforge/fatal-error-handler

A really simple class that can report fata errors by mail

  • Monday, October 12, 2015
  • by pscheit
  • Repository
  • 1 Watchers
  • 1 Stars
  • 65,550 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 3 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

webforge-fatal-error-handler

A really simple class that can report fata errors by mail, (*1)

installation

Use Composer to install., (*2)

composer require -v --prefer-source webforge/fatal-error-handler @stable

Usage

// 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)

Roadmap

  • add some simple rules to filter some errors (e.g. wanted errors from tests)

Known issues

  • sometimes dom library triggers the fatal error handler for entities that cannot be parsed

The Versions

12/10 2015

dev-master

9999999-dev

A really simple class that can report fata errors by mail

  Sources   Download

MIT

The Development Requires

by Philipp Scheit

22/10 2013

1.0.2

1.0.2.0

A really simple class that can report fata errors by mail

  Sources   Download

MIT

The Development Requires

by Philipp Scheit

16/10 2013

1.0.1

1.0.1.0

A really simple class that can report fata errors by mail

  Sources   Download

MIT

by Philipp Scheit

10/07 2013

1.0

1.0.0.0

A really simple class that can report fata errors by mail

  Sources   Download

MIT

by Philipp Scheit