class CRM_Core_Config_MagicMerge

Class CRM_Core_Config_MagicMerge

Originally, the $config object was based on a single, serialized data object stored in the database. As the needs for settings grew (with robust metadata, system overrides, extension support, and multi-tenancy), the $config started to store a mix of: (a) canonical config options, (b) dynamically generated runtime data, (c) cached data derived from other sources (esp civicrm_setting) (d) instances of service objects

The config object is now deprecated. Settings and service objects should generally be accessed via Civi::settings() and Civi::service().

MagicMerge provides backward compatibility. You may still access old properties via $config, but they will be loaded from their new services.

Methods

__construct()

CRM_Core_Config_MagicMerge constructor.

__wakeup()

Set the map to the property map.

static array
getPropertyMap()

Get a list of $config properties and the entities to which they map.

mixed
__get(string $k)

Get value.

__set(string $k, mixed $v)

Set value.

bool
__isset(string $k)

Is value set.

__unset(string $k)

Unset value.

getSettings()

No description

Details

at line 64
__construct()

CRM_Core_Config_MagicMerge constructor.

at line 71
__wakeup()

Set the map to the property map.

at line 86
static array getPropertyMap()

Get a list of $config properties and the entities to which they map.

This is used for two purposes:

  1. Runtime: Provide backward-compatible interface for reading these properties.
  2. Upgrade: Migrate old properties of config_backend into settings.

Return Value

array

at line 221
mixed __get(string $k)

Get value.

Parameters

string $k

Return Value

mixed

Exceptions

CRM_Core_Exception

at line 306
__set(string $k, mixed $v)

Set value.

Parameters

string $k
mixed $v

Exceptions

CRM_Core_Exception

at line 343
bool __isset(string $k)

Is value set.

Parameters

string $k

Return Value

bool

at line 354
__unset(string $k)

Unset value.

Parameters

string $k

Exceptions

CRM_Core_Exception

at line 390
protected SettingsBag getSettings()

Return Value

SettingsBag