Cgiapp2
[ class tree: Cgiapp2 ] [ index: Cgiapp2 ] [ all elements ]

Class: Cgiapp2_Exception_Observer_Mail

Source Location: /Cgiapp2/Exception/Observer/Mail.class.php

Class Overview


Cgiapp2_Exception_Observer_Mail


Author(s):

Version:

  • @release-version@

Copyright:

  • (c) 2006 - Present, Matthew Weier O'Phinney <mweierophinney@gmail.com>

Variables

Methods



Class Details

[line 56]
Cgiapp2_Exception_Observer_Mail

Cgiapp2_Exception observer. Mails exception information to a user.

Sample usage:

  1. require_once 'Cgiapp2/Exception/Observer/Mail.class.php';
  2.  
  3. // Set the mail recipient to 'mweierophinney@gmail.com'
  4. Cgiapp2_Exception_Observer_Mail:setRecipient('mweierophinney@gmail.com');
  5.  
  6. // Set the mail subject to 'Exception in application code'
  7. Cgiapp2_Exception_Observer_Mail:setSubject('Exception in application code');
  8.  
  9. try {
  10. throw new Cgiapp2_Exception('Mail this...');
  11. } catch (Cgiapp2_Exception $e) {
  12. // do something
  13. }




Tags:

version:  @release-version@
copyright:  (c) 2006 - Present, Matthew Weier O'Phinney <mweierophinney@gmail.com>
author:  Matthew Weier O'Phinney <mweierophinney@gmail.com>


[ Top ]


Class Variables

$subject =

[line 70]

Email subject



Tags:

access:  public

Type:   string


[ Top ]

$to =

[line 63]

Email recipient



Tags:

access:  public

Type:   string


[ Top ]



Class Methods


method event [line 155]

void event( Cgiapp2_Exception $e)

Mail a report

If no $to address is defined in the singleton instance, nothing is done. Otherwise, an email is sent with details of the exception.




Tags:

static:  
access:  public


Parameters:

Cgiapp2_Exception   $e  

[ Top ]

method getInstance [line 106]

Cgiapp2_Exception_Observer_Mail getInstance( [string $to = null], [string $subject = ''])

Singleton

Accepts recipient address and subject; uses sane default for subject ('Exception occurred in application').




Tags:

static:  
access:  public


Parameters:

string   $to  
string   $subject  

[ Top ]

method setRecipient [line 127]

void setRecipient( string $to)

Set mail recipient



Tags:

static:  
access:  public


Parameters:

string   $to  

[ Top ]

method setSubject [line 140]

void setSubject( string $subject)

Set mail subject



Tags:

static:  
access:  public


Parameters:

string   $subject  

[ Top ]


Documentation generated on Sat, 03 Jun 2006 10:48:52 -0400 by phpDocumentor 1.3.0RC5