CRM_Core_Config
class CRM_Core_Config extends CRM_Core_Config_MagicMerge
Class CRM_Core_Config
Properties
CRM_Utils_System_Base | $userSystem | ||
CRM_Core_Permission_Base | $userPermissionClass | ||
array | $enableComponents | ||
array | $languageLimit | ||
bool | $debug | ||
bool | $doNotResetCache | ||
string | $maxFileSize | ||
string | $defaultCurrency | ||
string | $defaultCurrencySymbol | ||
string | $lcMessages | ||
string | $fieldSeparator | ||
string | $userFramework | ||
string | $verpSeparator | ||
string | $dateFormatFull | ||
string | $resourceBase | ||
string | $dsn | ||
string | $customTemplateDir | ||
string | $defaultContactCountry | ||
string | $defaultContactStateProvince | ||
string | $monetaryDecimalPoint | ||
string | $monetaryThousandSeparator |
Methods
The constructor. Sets domain id if defined, otherwise assumes single instance installation.
Get a list of $config properties and the entities to which they map.
Singleton function used to manage this object.
Deletes the web server writable directories.
Verify that the needed parameters are not null in the config.
Reset the serialized array and recompute.
This method should initialize auth sources.
One function to get domain ID.
Function to get environment.
Do general cleanup of caches, temp directories and temp tables CRM-8739
Do general cleanup of module permissions.
Flush information about loaded modules.
Clear db cache.
Clear leftover temporary tables.
Check if running in upgrade mode.
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
Resets the singleton, so that the next call to CRM_Core_Config::singleton() reloads completely.
Conditionally fire an event during the first page run.
Is the system permitted to flush caches at the moment.
Set cache clearing to enabled or disabled.
Details
at line 89
__construct()
The constructor. Sets domain id if defined, otherwise assumes single instance installation.
in CRM_Core_Config_MagicMerge at line 72
__wakeup()
Set the map to the property map.
in CRM_Core_Config_MagicMerge at line 87
static array
getPropertyMap()
Get a list of $config properties and the entities to which they map.
This is used for two purposes:
- Runtime: Provide backward-compatible interface for reading these properties.
- Upgrade: Migrate old properties of config_backend into settings.
in CRM_Core_Config_MagicMerge at line 234
mixed
__get(string $k)
Get value.
in CRM_Core_Config_MagicMerge at line 323
__set(string $k, mixed $v)
Set value.
in CRM_Core_Config_MagicMerge at line 360
bool
__isset(string $k)
Is value set.
in CRM_Core_Config_MagicMerge at line 371
__unset(string $k)
Unset value.
in CRM_Core_Config_MagicMerge at line 407
protected SettingsBag
getSettings()
at line 103
static CRM_Core_Config
singleton(bool $loadFromDB = TRUE, bool $force = FALSE)
Singleton function used to manage this object.
at line 141
static object
getLog()
deprecated
deprecated
Returns the singleton logger for the application.
at line 156
static Mail
getMailer()
deprecated
deprecated
Retrieve a mailer to send any mail from the application.
at line 167
cleanup(int $value, bool $rmdir = TRUE)
Deletes the web server writable directories.
at line 203
static bool
check(CRM_Core_Config $config, array $required)
Verify that the needed parameters are not null in the config.
at line 216
reset()
Reset the serialized array and recompute.
use with care
at line 224
authenticate()
This method should initialize auth sources.
at line 252
static int|null
domainID(int $domainID = NULL, bool $reset = FALSE)
One function to get domain ID.
at line 272
static string
environment(string $env = NULL, bool $reset = FALSE)
Function to get environment.
at line 291
cleanupCaches(bool $sessionReset = TRUE)
Do general cleanup of caches, temp directories and temp tables CRM-8739
at line 309
cleanupPermissions()
Do general cleanup of module permissions.
at line 339
clearModuleList()
Flush information about loaded modules.
at line 349
static
clearDBCache()
Clear db cache.
at line 386
static
clearTempTables(string|bool $timeInterval = FALSE)
Clear leftover temporary tables.
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
at line 424
static bool
isUpgradeMode(string $path = NULL)
Check if running in upgrade mode.
at line 466
static bool
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
at line 473
addressSequence()
deprecated
deprecated
at line 481
defaultContactCountry()
deprecated
deprecated
at line 489
defaultContactCountryName()
deprecated
deprecated
at line 501
string
defaultCurrencySymbol(string $defaultCurrency = NULL)
deprecated
deprecated
at line 515
free()
Resets the singleton, so that the next call to CRM_Core_Config::singleton() reloads completely.
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).
at line 530
handleFirstRun()
Conditionally fire an event during the first page run.
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)
at line 583
static
isPermitCacheFlushMode()
Is the system permitted to flush caches at the moment.
at line 596
static
setPermitCacheFlushMode(bool $enabled)
Set cache clearing to enabled or disabled.
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.