Documentation

CRM_Core_BAO_ConfigSetting
in package

File contains functions used in civicrm configuration.

Table of Contents

Methods

add()  : mixed
Add civicrm settings.
applyLocale()  : mixed
Activate a chosen locale.
create()  : mixed
Create civicrm settings. This is the same as add but it clears the cache and reloads the config object
disableComponent()  : bool
Disable specified component.
doSiteMove()  : string
enableAllComponents()  : mixed
Ensure all components are enabled
enableComponent()  : bool
Takes a componentName and enables it in the config.
filterSkipVars()  : array<string|int, mixed>
retrieve()  : array<string|int, mixed>
Retrieve the settings values from db.
setEnabledComponents()  : mixed
Set enabled components.
skipVars()  : array<string|int, mixed>
getPathSettings()  : array<string|int, mixed>
getUrlSettings()  : array<string|int, mixed>

Methods

add()

Add civicrm settings.

public static add(array<string|int, mixed> &$params) : mixed

This method was historically used to access civicrm_domain.config_backend. However, that has been fully replaced by the settings system since v4.7.

Parameters
$params : array<string|int, mixed>

Associated array of civicrm variables.

applyLocale()

Activate a chosen locale.

public static applyLocale(SettingsBag $settings, string $activatedLocales) : mixed

The locale is set by updating the session and global variables.

When there is a choice of permitted languages (set on the "Administer" -> "Localisation" -> "Languages, Currency, Locations" screen) the locale to be applied can come from a variety of sources. The list below is the order of priority for deciding which of the sources "wins":

  • The request - when the "lcMessages" query variable is present in the URL.
  • The session - when the "lcMessages" session variable has been set.
  • Inherited from the CMS - when the "inheritLocale" setting is set.
  • CiviCRM settings - the fallback when none of the above set the locale.

Single-language installs skip this and always set the default locale.

Parameters
$settings : SettingsBag
$activatedLocales : string

Imploded list of locales which are supported in the DB.

create()

Create civicrm settings. This is the same as add but it clears the cache and reloads the config object

public static create(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

Associated array of civicrm variables.

disableComponent()

Disable specified component.

public static disableComponent(string $componentName) : bool
Parameters
$componentName : string
Return values
bool

doSiteMove()

public static doSiteMove([array<string|int, mixed> $defaultValues = [] ]) : string
Parameters
$defaultValues : array<string|int, mixed> = []
Tags
throws
Exception
Return values
string

enableComponent()

Takes a componentName and enables it in the config.

public static enableComponent(string $componentName) : bool

Primarily used during unit testing

Parameters
$componentName : string

Name of the component to be enabled, needs to be valid.

Return values
bool

true if valid component name and enabling succeeds, else false

filterSkipVars()

public static filterSkipVars(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

retrieve()

Retrieve the settings values from db.

public static retrieve(mixed &$defaults) : array<string|int, mixed>

This method was historically used to access civicrm_domain.config_backend. However, that has been fully replaced by the settings system since v4.7.

Parameters
$defaults : mixed
Return values
array<string|int, mixed>

setEnabledComponents()

Set enabled components.

public static setEnabledComponents(array<string|int, mixed> $enabledComponents) : mixed
Parameters
$enabledComponents : array<string|int, mixed>

skipVars()

public static skipVars() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPathSettings()

private static getPathSettings() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUrlSettings()

private static getUrlSettings() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results