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

Class: Base_Error

Source Location: /base_classes/error.class.php

Class Overview




Variables

Methods



Class Details

[line 47]


[ Top ]


Class Variables

static $instance =  null

[line 54]

Singleton



Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor __construct [line 65]

Base_Error __construct( string $handler, string $name, string $level)

Creates new Base_Error object. Takes the log handler, the log name and the log level for PEAR::Log as first, second and third argument.



Tags:

throws:  Base_ErrorException
access:  public


Parameters:

string   $handler   Log handler name
string   $name   Log name
string   $level   Log level name (PEAR_LOG*)

[ Top ]

method displayException [line 149]

void displayException( object error &$error_object, object smarty &$smarty, [string $template = 'error.html'])

Will display an exception error message using smarty. Takes the exception object as first argument, the smarty object as second argument and the name of the error template as third argument.

Please note that displayException() does not stop script execution.




Tags:

access:  public


Parameters:

object error   &$error_object   object (thrown exception)
object smarty   &$smarty   object
string   $template   Template name

[ Top ]

method phpErrorHandler [line 213]

void phpErrorHandler( int $code, string $message, string $file, int $line)

Error handler for php to be used through set_error_handler(). Takes the error code/level as first argument, the error message as second argument and the file and line where the error occurred as third and fourth argument.

Stops script execution on E_USER_ERROR and E_ERROR.




Tags:

access:  public


Parameters:

int   $code   Error code
string   $message   Error message
string   $file   File name
int   $line   Line number

[ Top ]

method printExceptionMessage [line 170]

void printExceptionMessage( object error &$error_object)

Will print an exception error message while returning ajax callbacks. Takes the exception object as first argument.

Please note that printExceptionMessage() does not stop script execution.




Tags:

access:  public


Parameters:

object error   &$error_object   object

[ Top ]

method triggerException [line 182]

void triggerException( object Exception &$error_object)

Logs exception as PEAR_LOG_ERR and stops script execution.

Takes the error object as first argument.




Tags:

access:  public


Parameters:

object Exception   &$error_object   object

[ Top ]

method triggerUserError [line 108]

void triggerUserError( int $code, string $message, string $file, int $line)

Triggers user error. Takes the error code/level as first argument, the error message as second argument and the file and line where the error occurred (use the constants __FILE__ and __LINE__) as third and fourth argument.

Valid values for the error code/level are BASE_ERROR_ERROR, BASE_ERROR_WARNING, BASE_ERROR_INFO and BASE_ERROR_DEBUG.

Stops script execution on BASE_ERROR_ERROR.




Tags:

access:  public


Parameters:

int   $code   Error code/level
string   $message   Error message
string   $file   File where the error occurred
int   $line   Line number where the error occurred

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:46 +0100 by phpDocumentor 1.4.3