Exponential Basic 2.4.0.1 Exponential Basic 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 23 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 55 of file ezexecution.php.

References registerShutdownHandler().

Referenced by ezpKernelWeb\__construct(), 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 75 of file ezexecution.php.

References registerShutdownHandler().

Referenced by ezpKernelTreeMenu\__construct(), ezpKernelRest\__construct(), ezpbKernelAdmin\setupFatalErrorHandler(), ezpbKernelWeb\setupFatalErrorHandler(), and ezpKernelWeb\setupFatalErrorHandler().

## ◆ 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 101 of file ezexecution.php.

References cleanup(), exit, and setCleanExit().

Referenced by eZFile\download(), eZSiteAccess\match(), ezpbKernelAdmin\redirect(), ezpbKernelWeb\redirect(), ezpKernelWeb\redirect(), ezpMobileDeviceRegexpFilter\redirect(), and response().

## ◆ cleanup()

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

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

Definition at line 37 of file ezexecution.php.

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

Referenced by cleanExit(), defaultExceptionHandler(), ezpKernelTreeMenu\exitWithInternalError(), ezpbKernelAdmin\shutdown(), ezpbKernelWeb\shutdown(), ezpKernelTreeMenu\shutdown(), ezpKernelWeb\shutdown(), ezpKernelRest\shutdown(), and uncleanShutdownHandler().

## ◆ cleanupHandlers()

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

Returns
  An array with cleanup handlers.

Definition at line 64 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 181 of file ezexecution.php.

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

## ◆ fatalErrorHandlers()

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

Returns
  An array with fatal error handlers.

Definition at line 84 of file ezexecution.php.

References $fatalErrorHandlers.

Referenced by uncleanShutdownHandler().

## ◆ isCleanExit()

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

Returns
  true if the request finished properly.

Definition at line 92 of file ezexecution.php.

References $hasCleanExit.

Referenced by uncleanShutdownHandler().

## ◆ registerShutdownHandler()

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

Register ::uncleanShutdownHandler as shutdown function

Definition at line 147 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 29 of file ezexecution.php.

References $hasCleanExit.

Referenced by cleanExit(), defaultExceptionHandler(), ezpKernelTreeMenu\exitWithInternalError(), ezpbKernelAdmin\requestInit(), ezpbKernelWeb\requestInit(), ezpKernelWeb\requestInit(), ezpbKernelAdmin\setupFatalErrorHandler(), ezpbKernelWeb\setupFatalErrorHandler(), ezpKernelWeb\setupFatalErrorHandler(), ezpbKernelAdmin\shutdown(), ezpbKernelWeb\shutdown(), ezpKernelTreeMenu\shutdown(), ezpKernelWeb\shutdown(), and ezpKernelRest\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 113 of file ezexecution.php.

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

## Member Data Documentation

## ◆ $cleanupHandlers

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

Definition at line 217 of file ezexecution.php.

Referenced by cleanupHandlers().

## ◆ $eZDocumentRoot

eZExecution::$eZDocumentRoot = null
| static private

Definition at line 213 of file ezexecution.php.

## ◆ $fatalErrorHandlers

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

Definition at line 216 of file ezexecution.php.

Referenced by fatalErrorHandlers().

## ◆ $hasCleanExit

eZExecution::$hasCleanExit = false
| static private

Definition at line 214 of file ezexecution.php.

Referenced by isCleanExit(), and setCleanExit().

## ◆ $shutdownHandle

eZExecution::$shutdownHandle = false
| static private

Definition at line 215 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+.