PHP Class eZExecution

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.
Datei anzeigen Open project: ezsystems/ezpublish-legacy Class Usage Examples

Public Methods

Method Description
addCleanupHandler ( $handler ) *! Adds a cleanup handler to the end of the list, \a $handler must contain the name of the function to call.
addFatalErrorHandler ( $handler ) *! Adds a fatal error handler to the end of the list, \a $handler must contain the name of the function to call.
cleanExit ( ) *! Sets the clean exit flag and exits the page.
cleanup ( ) *! Calls the cleanup handlers to make sure that the script is ready to exit.
cleanupHandlers ( ) *! \return An array with cleanup handlers.
defaultExceptionHandler ( $e ) : void Installs the default Exception handler
fatalErrorHandlers ( ) *! \return An array with fatal error handlers.
isCleanExit ( ) *! \return true if the request finished properly.
registerShutdownHandler ( $documentRoot = false ) *! Register ::uncleanShutdownHandler as shutdown function
setCleanExit ( $hasCleanExit = true ) *! Sets the clean exit flag to on, this notifies the exit handler that everything finished properly.
uncleanShutdownHandler ( ) *! 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.

Method Details

addCleanupHandler() static public method

The function is called at the end of the script execution to do some cleanups.
static public addCleanupHandler ( $handler )

addFatalErrorHandler() static public method

The handler will be called whenever a fatal error occurs, which usually happens when the script did not finish.
static public addFatalErrorHandler ( $handler )

cleanExit() static public method

Use this if you want premature exits instead of the \c exit function.
static public cleanExit ( )

cleanup() static public method

*! Calls the cleanup handlers to make sure that the script is ready to exit.
static public cleanup ( )

cleanupHandlers() static public method

*! \return An array with cleanup handlers.
static public cleanupHandlers ( )

defaultExceptionHandler() public static method

Installs the default Exception handler
public static defaultExceptionHandler ( $e ) : void
return void

fatalErrorHandlers() static public method

*! \return An array with fatal error handlers.
static public fatalErrorHandlers ( )

isCleanExit() static public method

*! \return true if the request finished properly.
static public isCleanExit ( )

registerShutdownHandler() public static method

*! Register ::uncleanShutdownHandler as shutdown function
public static registerShutdownHandler ( $documentRoot = false )

setCleanExit() static public method

*! Sets the clean exit flag to on, this notifies the exit handler that everything finished properly.
static public setCleanExit ( $hasCleanExit = true )

uncleanShutdownHandler() static public method

*! 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.
static public uncleanShutdownHandler ( )