SettingsStack
in package
Class SettingsStack
The settings stack allows you to temporarily change (then restore) settings. It's intended primarily for use in testing.
Like the global $civicrm_setting
variable, it works best with typical inert settings that
do not trigger extra activation logic. A handful of settings (such as enable_components
and ~5 others) should be avoided, but most settings should work.
Table of Contents
Properties
- $stack : array<string|int, mixed>
Methods
Properties
$stack
protected
array<string|int, mixed>
$stack
= []
Ex: $stack[0] == ['settingName', 'oldSettingValue'];
Methods
popAll()
Restore original settings.
public
popAll() : mixed
push()
Temporarily apply a setting.
public
push(mixed $setting, mixed $settingValue) : mixed
Parameters
- $setting : mixed
- $settingValue : mixed