Open Journal Systems  3.3.0
PEAR_Exception Class Reference
Inheritance diagram for PEAR_Exception:

Public Member Functions

 __construct ($message, $p2=null, $p3=null)
 
 __toString ()
 
 getCause ()
 
 getCauseMessage (&$causes)
 
 getErrorClass ()
 
 getErrorData ()
 
 getErrorMethod ()
 
 getTraceSafe ()
 
 toHtml ()
 
 toText ()
 

Static Public Member Functions

static addObserver ($callback, $label='default')
 
static getUniqueId ()
 
static removeObserver ($label='default')
 

Data Fields

const OBSERVER_DIE = -8
 
const OBSERVER_PRINT = -2
 
const OBSERVER_TRIGGER = -4
 

Protected Member Functions

 signal ()
 

Protected Attributes

 $cause
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

PEAR_Exception::__construct (   $message,
  $p2 = null,
  $p3 = null 
)

Supported signatures:

Parameters
string$messageexception message
int | Exception | PEAR_Error | array | null$p2exception cause
int | null$p3exception code or null

Definition at line 120 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References signal().

Member Function Documentation

◆ __toString()

PEAR_Exception::__toString ( )

Converts the exception to a string (HTML or plain text)

Returns
string String representation
See also
toHtml()
toText()

Definition at line 363 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References toHtml(), and toText().

◆ addObserver()

static PEAR_Exception::addObserver (   $callback,
  $label = 'default' 
)
static

Add an exception observer

Parameters
mixed$callback- A valid php callback, see php func is_callable()
  • A PEAR_Exception::OBSERVER_* constant
  • An array(const PEAR_Exception::OBSERVER_*, mixed $options)
string$labelThe name of the observer. Use this if you want to remove it later with removeObserver()
Returns
void

Definition at line 161 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

◆ getCause()

PEAR_Exception::getCause ( )

Returns the exception that caused this exception to be thrown

Returns
Exception|array The context of the exception

Definition at line 245 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References $cause.

◆ getCauseMessage()

PEAR_Exception::getCauseMessage ( $causes)

Function must be public to call on caused exceptions

Parameters
array$causesArray that gets filled.
Returns
void

Definition at line 257 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References $cause, and getTraceSafe().

Referenced by toHtml(), and toText().

◆ getErrorClass()

PEAR_Exception::getErrorClass ( )

Gets the first class of the backtrace

Returns
string Class name

Definition at line 338 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References getTraceSafe().

◆ getErrorData()

PEAR_Exception::getErrorData ( )

Return specific error information that can be used for more detailed error messages or translation.

This method may be overridden in child exception classes in order to add functionality not present in PEAR_Exception and is a placeholder to define API

The returned array must be an associative array of parameter => value like so:

array('name' => $name, 'context' => array(...))
Returns
array

Definition at line 235 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

◆ getErrorMethod()

PEAR_Exception::getErrorMethod ( )

Gets the first method of the backtrace

Returns
string Method/function name

Definition at line 349 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References getTraceSafe().

◆ getTraceSafe()

PEAR_Exception::getTraceSafe ( )

Build a backtrace and return it

Returns
array Backtrace

Definition at line 321 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

Referenced by getCauseMessage(), getErrorClass(), getErrorMethod(), and toHtml().

◆ getUniqueId()

static PEAR_Exception::getUniqueId ( )
static

Generate a unique ID for an observer

Returns
int unique identifier for an observer

Definition at line 183 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

◆ removeObserver()

static PEAR_Exception::removeObserver (   $label = 'default')
static

Remove an exception observer

Parameters
string$labelName of the observer
Returns
void

Definition at line 173 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

◆ signal()

PEAR_Exception::signal ( )
protected

Send a signal to all observers

Returns
void

Definition at line 193 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References OBSERVER_DIE, OBSERVER_PRINT, and OBSERVER_TRIGGER.

Referenced by __construct().

◆ toHtml()

PEAR_Exception::toHtml ( )

Generates a HTML representation of the exception

Returns
string HTML code

Definition at line 376 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References $cause, getCauseMessage(), and getTraceSafe().

Referenced by __toString().

◆ toText()

PEAR_Exception::toText ( )

Generates text representation of the exception and stack trace

Returns
string

Definition at line 443 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

References $cause, and getCauseMessage().

Referenced by __toString().

Field Documentation

◆ $cause

PEAR_Exception::$cause
protected

◆ OBSERVER_DIE

const PEAR_Exception::OBSERVER_DIE = -8

Definition at line 99 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

Referenced by signal().

◆ OBSERVER_PRINT

const PEAR_Exception::OBSERVER_PRINT = -2

Definition at line 97 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

Referenced by signal().

◆ OBSERVER_TRIGGER

const PEAR_Exception::OBSERVER_TRIGGER = -4

Definition at line 98 of file generic/pln/vendor/pear/pear_exception/PEAR/Exception.php.

Referenced by signal().


The documentation for this class was generated from the following file: