Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Static Public Member Functions | Static Private Attributes | List of all members
eZExecution Class Reference

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

## Static Public Member Functions
static | setCleanExit ( $hasCleanExit=true)
static | cleanup ()
static | addCleanupHandler ( $handler)
static | cleanupHandlers ()
static | addFatalErrorHandler ( $handler)
static | fatalErrorHandlers ()
static | isCleanExit ()
static | cleanExit ()
static | uncleanShutdownHandler ()
static | registerShutdownHandler ( $documentRoot=false)
static | defaultExceptionHandler ( $e)

## Static Private Attributes
static | $eZDocumentRoot = null
static | $hasCleanExit = false
static | $shutdownHandle = false
static | $fatalErrorHandlers = array()
static | $cleanupHandlers = array()

## 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.

Definition at line 22 of file ezexecution.php.

## Member Function Documentation

## ◆ addCleanupHandler()

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.

Definition at line 54 of file ezexecution.php.

References registerShutdownHandler().

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

## ◆ addFatalErrorHandler()

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.

Definition at line 74 of file ezexecution.php.

References registerShutdownHandler().

Referenced by eZScript\initialize().

## ◆ cleanExit()

static eZExecution::cleanExit | ( |  | ) |
| static

Sets the clean exit flag and exits the page. Use this if you want premature exits instead of the `exit` function.

Definition at line 100 of file ezexecution.php.

References cleanup(), and setCleanExit().

Referenced by eZUserLoginHandler\checkUser(), eZFile\download(), eZFilePassthroughHandler\handleFileDownload(), eZUser\instance(), eZSiteAccess\match(), eZModule\redirectTo(), eZHTTPTool\sendHTTPRequest(), eZContentObjectTreeNodeOperations\showNotificationAfterCopying(), and Cpdf\stream().

## ◆ cleanup()

static eZExecution::cleanup | ( |  | ) |
| static

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

Definition at line 36 of file ezexecution.php.

References cleanupHandlers(), and eZDebug\writeError().

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

## ◆ cleanupHandlers()

static eZExecution::cleanupHandlers | ( |  | ) |
| static

Returns
  An array with cleanup handlers.

Definition at line 63 of file ezexecution.php.

References $cleanupHandlers.

Referenced by cleanup().

## ◆ defaultExceptionHandler()

static eZExecution::defaultExceptionHandler | ( |  | $e | ) |
| static

Installs the default Exception handler

@params Exception|Throwable the exception

Returns
  void

Definition at line 180 of file ezexecution.php.

References cleanup(), eZCLI\instance(), eZDebug\isDebugEnabled(), setCleanExit(), and eZLog\write().

## ◆ fatalErrorHandlers()

static eZExecution::fatalErrorHandlers | ( |  | ) |
| static

Returns
  An array with fatal error handlers.

Definition at line 83 of file ezexecution.php.

References $fatalErrorHandlers.

Referenced by uncleanShutdownHandler().

## ◆ isCleanExit()

static eZExecution::isCleanExit | ( |  | ) |
| static

Returns
  true if the request finished properly.

Definition at line 91 of file ezexecution.php.

References $hasCleanExit.

Referenced by uncleanShutdownHandler().

## ◆ registerShutdownHandler()

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

Register ::uncleanShutdownHandler as shutdown function

Definition at line 146 of file ezexecution.php.

Referenced by addCleanupHandler(), and addFatalErrorHandler().

## ◆ setCleanExit()

static eZExecution::setCleanExit | ( |  | $hasCleanExit = `true` | ) |
| static

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

Definition at line 28 of file ezexecution.php.

References $hasCleanExit.

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

## ◆ uncleanShutdownHandler()

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.

Definition at line 112 of file ezexecution.php.

References cleanup(), fatalErrorHandlers(), isCleanExit(), and eZDebug\writeError().

## Member Data Documentation

## ◆ $cleanupHandlers

eZExecution::$cleanupHandlers = array()
| static private

Definition at line 216 of file ezexecution.php.

Referenced by cleanupHandlers().

## ◆ $eZDocumentRoot

eZExecution::$eZDocumentRoot = null
| static private

Definition at line 212 of file ezexecution.php.

## ◆ $fatalErrorHandlers

eZExecution::$fatalErrorHandlers = array()
| static private

Definition at line 215 of file ezexecution.php.

Referenced by fatalErrorHandlers().

## ◆ $hasCleanExit

eZExecution::$hasCleanExit = false
| static private

Definition at line 213 of file ezexecution.php.

Referenced by isCleanExit(), and setCleanExit().

## ◆ $shutdownHandle

eZExecution::$shutdownHandle = false
| static private

Definition at line 214 of file ezexecution.php.

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

- ezexecution.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.