class CRM_Utils_AutoClean

Class CRM_Utils_AutoClean

Automatically cleanup state when the object handle is released. This is useful for unordered cleanup when a function has many different exit scenarios (eg multiple returns, exceptions).

Properties

protected $callback
protected $args

Methods

with(mixed $callback)

Call a cleanup function when the current context shuts down.

swap(mixed $getter, mixed $setter, mixed $tmpValue)

Temporarily swap values using callback functions, and cleanup when the current context shuts down.

__destruct()

No description

__sleep()

Prohibit (de)serialization of CRM_Utils_AutoClean.

__wakeup()

Prohibit (de)serialization of CRM_Utils_AutoClean.

Details

at line 60
static CRM_Utils_AutoClean with(mixed $callback)

Call a cleanup function when the current context shuts down.

Parameters

mixed $callback

Return Value

CRM_Utils_AutoClean

at line 87
static CRM_Utils_AutoClean swap(mixed $getter, mixed $setter, mixed $tmpValue)

Temporarily swap values using callback functions, and cleanup when the current context shuts down.

Parameters

mixed $getter Function to lookup current value.
mixed $setter Function to set new value.
mixed $tmpValue The value to temporarily use.

Return Value

CRM_Utils_AutoClean

See also

Resolver

at line 101
__destruct()

at line 111
__sleep()

Prohibit (de)serialization of CRM_Utils_AutoClean.

The generic nature of AutoClean makes it a potential target for escalating serialization vulnerabilities, and there's no good reason for serializing it.

at line 121
__wakeup()

Prohibit (de)serialization of CRM_Utils_AutoClean.

The generic nature of AutoClean makes it a potential target for escalating serialization vulnerabilities, and there's no good reason for deserializing it.