CRM_Core_Config
extends CRM_Core_Config_MagicMerge
in package
Class CRM_Core_Config
Tags
Table of Contents
Properties
- $customTemplateDir : string
- $dateFormatFull : string
- $debug : bool
- $defaultContactCountry : string
- $defaultContactStateProvince : string
- $defaultCurrency : string
- $defaultCurrencySymbol : string
- $doNotResetCache : bool
- $dsn : string
- $enableComponents : array<string|int, mixed>
- $fieldSeparator : string
- $languageLimit : array<string|int, mixed>
- $lcMessages : string
- $maxFileSize : string
- $monetaryDecimalPoint : string
- $monetaryThousandSeparator : string
- $resourceBase : string
- $userFramework : string
- $userPermissionClass : CRM_Core_Permission_Base
- $userSystem : CRM_Utils_System_Base
- $verpSeparator : string
- $_log : object
- The handle to the log that we are using
- $_singleton : CRM_Core_Config
- We only need one instance of this object. So we use the singleton pattern and cache the instance in this variable
- $cache : mixed
- $locals : mixed
- $map : array<string|int, mixed>
- Map old config properties to their contemporary counterparts.
- $settings : mixed
Methods
- __construct() : mixed
- CRM_Core_Config_MagicMerge constructor.
- __get() : mixed
- Get value.
- __isset() : bool
- Is value set.
- __set() : mixed
- Set value.
- __unset() : mixed
- Unset value.
- __wakeup() : mixed
- Set the map to the property map.
- addressSequence() : mixed
- authenticate() : mixed
- This method should initialize auth sources.
- check() : bool
- Verify that the needed parameters are not null in the config.
- cleanup() : mixed
- Deletes the web server writable directories.
- cleanupCaches() : mixed
- Do general cleanup of caches, temp directories and temp tables
- cleanupPermissions() : mixed
- Do general cleanup of module permissions.
- clearDBCache() : void
- Clear db cache.
- clearModuleList() : mixed
- Flush information about loaded modules.
- clearTempTables() : void
- Clear leftover temporary tables.
- defaultContactCountry() : mixed
- defaultContactCountryName() : mixed
- defaultCurrencySymbol() : string
- domainID() : int
- One function to get domain ID.
- environment() : string
- Function to get environment.
- free() : mixed
- Resets the singleton, so that the next call to CRM_Core_Config::singleton() reloads completely.
- getLog() : object
- Returns the singleton logger for the application.
- getMailer() : Mail
- Retrieve a mailer to send any mail from the application.
- getPropertyMap() : array<string|int, mixed>
- Get a list of $config properties and the entities to which they map.
- handleFirstRun() : mixed
- Conditionally fire an event during the first page run.
- isEnabledBackOfficeCreditCardPayments() : bool
- Is back office credit card processing enabled for this site - ie are there any installed processors that support it? This function is used for determining whether to show the submit credit card link, not for determining which processors to show, hence it is a config var
- isPermitCacheFlushMode() : mixed
- Is the system permitted to flush caches at the moment.
- isUpgradeMode() : bool
- Check if running in upgrade mode.
- reset() : mixed
- Reset the serialized array and recompute.
- setPermitCacheFlushMode() : mixed
- Set cache clearing to enabled or disabled.
- singleton() : CRM_Core_Config
- Singleton function used to manage this object.
- getSettings() : SettingsBag
- initLocals() : mixed
- Initialise local settings.
Properties
$customTemplateDir
public
string
$customTemplateDir
$dateFormatFull
public
string
$dateFormatFull
$debug
public
bool
$debug
$defaultContactCountry
public
string
$defaultContactCountry
$defaultContactStateProvince
public
string
$defaultContactStateProvince
$defaultCurrency
public
string
$defaultCurrency
$defaultCurrencySymbol
public
string
$defaultCurrencySymbol
$doNotResetCache
public
bool
$doNotResetCache
$dsn
public
string
$dsn
$enableComponents
public
array<string|int, mixed>
$enableComponents
$fieldSeparator
public
string
$fieldSeparator
$languageLimit
public
array<string|int, mixed>
$languageLimit
$lcMessages
public
string
$lcMessages
$maxFileSize
public
string
$maxFileSize
$monetaryDecimalPoint
public
string
$monetaryDecimalPoint
$monetaryThousandSeparator
public
string
$monetaryThousandSeparator
$resourceBase
public
string
$resourceBase
$userFramework
public
string
$userFramework
$userPermissionClass
public
CRM_Core_Permission_Base
$userPermissionClass
$userSystem
public
CRM_Utils_System_Base
$userSystem
$verpSeparator
public
string
$verpSeparator
$_log
The handle to the log that we are using
private
static object
$_log
= \NULL
$_singleton
We only need one instance of this object. So we use the singleton pattern and cache the instance in this variable
private
static CRM_Core_Config
$_singleton
$cache
private
mixed
$cache
= []
$locals
private
mixed
$locals
$map
Map old config properties to their contemporary counterparts.
private
array<string|int, mixed>
$map
Array(string $configAlias => Array(string $realType, string $realName)).
$settings
private
mixed
$settings
Methods
__construct()
CRM_Core_Config_MagicMerge constructor.
public
__construct() : mixed
__get()
Get value.
public
__get(string $k) : mixed
Parameters
- $k : string
Tags
__isset()
Is value set.
public
__isset(string $k) : bool
Parameters
- $k : string
Return values
bool__set()
Set value.
public
__set(string $k, mixed $v) : mixed
Parameters
- $k : string
- $v : mixed
Tags
__unset()
Unset value.
public
__unset(string $k) : mixed
Parameters
- $k : string
Tags
__wakeup()
Set the map to the property map.
public
__wakeup() : mixed
addressSequence()
public
addressSequence() : mixed
authenticate()
This method should initialize auth sources.
public
authenticate() : mixed
check()
Verify that the needed parameters are not null in the config.
public
static check(CRM_Core_Config &$config, array<string|int, mixed> &$required) : bool
Parameters
- $config : CRM_Core_Config
-
(reference) the system config object
- $required : array<string|int, mixed>
-
(reference) the parameters that need a value
Return values
boolcleanup()
Deletes the web server writable directories.
public
cleanup(int $value[, bool $rmdir = TRUE ]) : mixed
Parameters
- $value : int
-
1: clean templates_c, 2: clean upload, 3: clean both
- $rmdir : bool = TRUE
cleanupCaches()
Do general cleanup of caches, temp directories and temp tables
public
cleanupCaches([bool $sessionReset = FALSE ]) : mixed
Parameters
- $sessionReset : bool = FALSE
Tags
cleanupPermissions()
Do general cleanup of module permissions.
public
cleanupPermissions() : mixed
clearDBCache()
Clear db cache.
public
static clearDBCache() : void
clearModuleList()
Flush information about loaded modules.
public
clearModuleList() : mixed
clearTempTables()
Clear leftover temporary tables.
public
static clearTempTables([string|bool $timeInterval = FALSE ]) : void
This is called on upgrade, during tests and site move, from the cron and via clear caches in the UI.
Currently the UI clear caches does not pass a time interval - which may need review as it does risk ripping the tables out from underneath a current action. This was considered but out-of-scope for CRM-16167
Parameters
- $timeInterval : string|bool = FALSE
-
Optional time interval for mysql date function.g '2 day'. This can be used to prevent tables created recently from being deleted.
defaultContactCountry()
public
defaultContactCountry() : mixed
defaultContactCountryName()
public
defaultContactCountryName() : mixed
defaultCurrencySymbol()
public
defaultCurrencySymbol([string $defaultCurrency = NULL ]) : string
Parameters
- $defaultCurrency : string = NULL
Return values
stringdomainID()
One function to get domain ID.
public
static domainID([int $domainID = NULL ][, bool $reset = FALSE ]) : int
Parameters
- $domainID : int = NULL
- $reset : bool = FALSE
Return values
intenvironment()
Function to get environment.
public
static environment([string $env = NULL ][, bool $reset = FALSE ]) : string
Parameters
- $env : string = NULL
- $reset : bool = FALSE
Return values
stringfree()
Resets the singleton, so that the next call to CRM_Core_Config::singleton() reloads completely.
public
free() : mixed
While normally we could call the singleton function with $force = TRUE, this function addresses a very specific use-case in the CiviCRM installer, where we cannot yet force a reload, but we want to make sure that the next call to this object gets a fresh start (ex: to initialize the DAO).
getLog()
Returns the singleton logger for the application.
public
static & getLog() : object
Tags
Return values
objectgetMailer()
Retrieve a mailer to send any mail from the application.
public
static getMailer() : Mail
Tags
Return values
MailgetPropertyMap()
Get a list of $config properties and the entities to which they map.
public
static getPropertyMap() : array<string|int, mixed>
This is used for two purposes:
- Runtime: Provide backward-compatible interface for reading these properties.
- Upgrade: Migrate old properties of config_backend into settings.
Return values
array<string|int, mixed>handleFirstRun()
Conditionally fire an event during the first page run.
public
handleFirstRun() : mixed
The install system is currently implemented several times, so it's hard to add new installation logic. We use a makeshift method to detect the first run.
Situations to test:
- New installation
- Upgrade from an old version (predating first-run tracker)
- Upgrade from an old version (with first-run tracking)
isEnabledBackOfficeCreditCardPayments()
Is back office credit card processing enabled for this site - ie are there any installed processors that support it? This function is used for determining whether to show the submit credit card link, not for determining which processors to show, hence it is a config var
public
static isEnabledBackOfficeCreditCardPayments() : bool
Return values
boolisPermitCacheFlushMode()
Is the system permitted to flush caches at the moment.
public
static isPermitCacheFlushMode() : mixed
isUpgradeMode()
Check if running in upgrade mode.
public
static isUpgradeMode([string $path = NULL ]) : bool
Parameters
- $path : string = NULL
Return values
boolreset()
Reset the serialized array and recompute.
public
reset() : mixed
use with care
setPermitCacheFlushMode()
Set cache clearing to enabled or disabled.
public
static setPermitCacheFlushMode(bool $enabled) : mixed
This might be enabled at the start of a long running process such as an import in order to delay clearing caches until the end.
Parameters
- $enabled : bool
-
If true then caches can be cleared at this time.
singleton()
Singleton function used to manage this object.
public
static & singleton([bool $loadFromDB = TRUE ][, bool $force = FALSE ]) : CRM_Core_Config
Parameters
- $loadFromDB : bool = TRUE
-
whether to load from the database.
- $force : bool = FALSE
-
whether to force a reconstruction.
Return values
CRM_Core_ConfiggetSettings()
protected
getSettings() : SettingsBag
Return values
SettingsBaginitLocals()
Initialise local settings.
private
initLocals() : mixed