Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Exception Mailer

linusnorton edited this page Dec 30, 2011 · 1 revision

The exception handler uses the observer pattern to allow objects to be notified of exceptions.

The exception mailer can be attached to the exception handler so that it sends an email every time an error or exception occurs.

/**
 * Set up error emailing
 */ 
public function init() {
    parent::init();

    $recipient = $this->dic->registry->get("ADMIN");
    $mailer = new \xframe\exception\Mailer($recipient);
    $this->dic->exceptionHandler->attach($mailer);
}    
Clone this wiki locally