Changelog
README
Cgiapp2_Exception observer. Mails exception information to a user.
Sample usage:
require_once 'Cgiapp2/Exception/Observer/Mail.class.php'; // Set the mail recipient to 'mweierophinney@gmail.com' Cgiapp2_Exception_Observer_Mail:setRecipient('mweierophinney@gmail.com'); // Set the mail subject to 'Exception in application code' Cgiapp2_Exception_Observer_Mail:setSubject('Exception in application code'); try { throw new Cgiapp2_Exception('Mail this...'); } catch (Cgiapp2_Exception $e) { // do something }
[line 70]
[line 63]
void event( Cgiapp2_Exception $e)
If no $to address is defined in the singleton instance, nothing is done. Otherwise, an email is sent with details of the exception.
Cgiapp2_Exception_Observer_Mail getInstance( [string $to = null], [string $subject = ''])
Accepts recipient address and subject; uses sane default for subject ('Exception occurred in application').
void setRecipient( string $to)
void setSubject( string $subject)