Documentation

CRM_Core_TemporaryErrorScope
in package

This is an evil, evil work-around for CRM-11043. It is used to temporarily change the error-handling behavior and then automatically restore it -- that protocol is an improvement over the current protocol (in which random bits of code will change the global error handler setting and then forget to change it back). This class and all references to it should be removed in 4.3/4.4 (when we adopt exception-based error handling).

To ensure that new errors arising during execution of the current function are immediately fatal, use:

To ensure that they throw exceptions, use:

$errorScope = CRM_Core_TemporaryErrorScope::useException();

Note that relying on this is a code-smell: it can be safe to temporarily switch to exception

Table of Contents

Properties

$oldFrames  : mixed

Methods

__construct()  : mixed
__destruct()  : mixed
create()  : CRM_Core_TemporaryErrorScope
getActive()  : mixed
Read the active error-handler settings
ignoreException()  : CRM_Core_TemporaryErrorScope
setActive()  : mixed
Set the active error-handler settings
useException()  : CRM_Core_TemporaryErrorScope

Properties

Methods

__construct()

public __construct(mixed $newFrame) : mixed
Parameters
$newFrame : mixed

getActive()

Read the active error-handler settings

public static getActive() : mixed

setActive()

Set the active error-handler settings

public static setActive(string $frame) : mixed
Parameters
$frame : string

        
On this page

Search results