eZPublish  4.4
eZExecution Class Reference

Handles proper script execution, fatal error detection and handling. More...

Static Public Member Functions

static addCleanupHandler ($handler)
 
static addFatalErrorHandler ($handler)
 
static cleanExit ()
 
static cleanup ()
 
static cleanupHandlers ()
 
static defaultExceptionHandler (Exception $e)
 Installs the default Exception handler. More...
 
static fatalErrorHandlers ()
 
static isCleanExit ()
 
static registerShutdownHandler ($documentRoot=false)
 
static setCleanExit ()
 
static uncleanShutdownHandler ()
 

Static Private Attributes

static $cleanupHandlers = array()
 
static $eZDocumentRoot = null
 
static $fatalErrorHandlers = array()
 
static $hasCleanExit = false
 
static $shutdownHandle = false
 

Detailed Description

Handles proper script execution, fatal error detection and handling.

By registering a fatal error handler it's possible for the PHP script to catch fatal errors, such as "Call to a member function on a non-object".

By registering a cleanup handler it's possible to make sure the script can end properly.

Member Function Documentation

static eZExecution::addCleanupHandler (   $handler)
static

Adds a cleanup handler to the end of the list, $handler must contain the name of the function to call. The function is called at the end of the script execution to do some cleanups.

Referenced by eZScript\initialize(), and eZClusterFileHandler\instance().

static eZExecution::addFatalErrorHandler (   $handler)
static

Adds a fatal error handler to the end of the list, $handler must contain the name of the function to call. The handler will be called whenever a fatal error occurs, which usually happens when the script did not finish.

Referenced by eZScript\initialize().

static eZExecution::cleanExit ( )
static
static eZExecution::cleanup ( )
static

Calls the cleanup handlers to make sure that the script is ready to exit.

Referenced by cleanExit(), defaultExceptionHandler(), exitWithInternalError(), eZScript\initialize(), eZDBInterface\reportError(), eZScript\shutdown(), and uncleanShutdownHandler().

static eZExecution::cleanupHandlers ( )
static
Returns
An array with cleanup handlers.

Referenced by cleanup().

static eZExecution::defaultExceptionHandler ( Exception  $e)
static

Installs the default Exception handler.

Exception the exception

Returns
void
static eZExecution::fatalErrorHandlers ( )
static
Returns
An array with fatal error handlers.

Referenced by uncleanShutdownHandler().

static eZExecution::isCleanExit ( )
static
Returns
true if the request finished properly.

Referenced by uncleanShutdownHandler().

static eZExecution::registerShutdownHandler (   $documentRoot = false)
static

Register ::uncleanShutdownHandler as shutdown function

static eZExecution::setCleanExit ( )
static

Sets the clean exit flag to on, this notifies the exit handler that everything finished properly.

Referenced by cleanExit(), defaultExceptionHandler(), exitWithInternalError(), eZScript\initialize(), eZDBInterface\reportError(), and eZScript\shutdown().

static eZExecution::uncleanShutdownHandler ( )
static

Exit handler which called after the script is done, if it detects that eZ Publish did not exit cleanly it will issue an error message and display the debug.

Member Data Documentation

eZExecution::$cleanupHandlers = array()
staticprivate
eZExecution::$eZDocumentRoot = null
staticprivate
eZExecution::$fatalErrorHandlers = array()
staticprivate
eZExecution::$hasCleanExit = false
staticprivate
eZExecution::$shutdownHandle = false
staticprivate

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