<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
class CRM_Core_BAO_ConfigSetting {
/**
- * create civicrm settings. This is the same as add but it clears the cache and
+ * Create civicrm settings. This is the same as add but it clears the cache and
* reloads the config object
*
- * @param array $params associated array of civicrm variables
+ * @param array $params
+ * Associated array of civicrm variables.
*
* @return null
* @static
*/
- static function create($params) {
+ public static function create($params) {
self::add($params);
$cache = CRM_Utils_Cache::singleton();
$cache->delete('CRM_Core_Config');
}
/**
- * add civicrm settings
+ * Add civicrm settings
*
- * @param array $params associated array of civicrm variables
+ * @param array $params
+ * Associated array of civicrm variables.
*
* @return null
* @static
*/
- static function add(&$params) {
+ public static function add(&$params) {
self::fixParams($params);
// also set a template url so js files can use this
}
/**
- * fix civicrm setting variables
+ * Fix civicrm setting variables
*
- * @param array $params associated array of civicrm variables
+ * @param array $params
+ * Associated array of civicrm variables.
*
* @return null
* @static
*/
- static function fixParams(&$params) {
+ public static function fixParams(&$params) {
// in our old civicrm.settings.php we were using ISO code for country and
// province limit, now we have changed it to use ids
}
/**
- * Function to format the array containing before inserting in db
+ * Format the array containing before inserting in db
*
- * @param array $params associated array of civicrm variables(submitted)
- * @param array $values associated array of civicrm variables stored in db
+ * @param array $params
+ * Associated array of civicrm variables(submitted).
+ * @param array $values
+ * Associated array of civicrm variables stored in db.
*
* @return null
* @static
*/
- static function formatParams(&$params, &$values) {
+ public static function formatParams(&$params, &$values) {
if (empty($params) ||
!is_array($params)
) {
}
/**
- * Function to retrieve the settings values from db
+ * Retrieve the settings values from db
*
* @param $defaults
*
* @return array $defaults
* @static
*/
- static function retrieve(&$defaults) {
+ public static function retrieve(&$defaults) {
$domain = new CRM_Core_DAO_Domain();
//we are initializing config, really can't use, CRM-7863
}
}
- if ($lcMessages) {
- // update config lcMessages - CRM-5027 fixed.
- $defaults['lcMessages'] = $lcMessages;
- }
- else {
- // if a single-lang site or the above didn't yield a result, use default
+ if (empty($lcMessages)) {
+ //CRM-11993 - if a single-lang site, use default
$lcMessages = CRM_Utils_Array::value('lcMessages', $defaults);
}
/**
* @return array
*/
- static function getConfigSettings() {
+ public static function getConfigSettings() {
$config = CRM_Core_Config::singleton();
$url = $dir = $siteName = $siteRoot = NULL;
* - $siteName
* - $siteRoot
*/
- static function getBestGuessSettings() {
+ public static function getBestGuessSettings() {
$config = CRM_Core_Config::singleton();
//CRM-15365 - Fix preg_replace to handle backslash for Windows File Paths
* @return string
* @throws Exception
*/
- static function doSiteMove($defaultValues = array()) {
+ public static function doSiteMove($defaultValues = array()) {
$moveStatus = ts('Beginning site move process...') . '<br />';
// get the current and guessed values
list($oldURL, $oldDir, $oldSiteName, $oldSiteRoot) = self::getConfigSettings();
}
/**
- * takes a componentName and enables it in the config
+ * Takes a componentName and enables it in the config
* Primarily used during unit testing
*
- * @param string $componentName name of the component to be enabled, needs to be valid
+ * @param string $componentName
+ * Name of the component to be enabled, needs to be valid.
*
* @return boolean - true if valid component name and enabling succeeds, else false
* @static
*/
- static function enableComponent($componentName) {
+ public static function enableComponent($componentName) {
$config = CRM_Core_Config::singleton();
if (in_array($componentName, $config->enableComponents)) {
// component is already enabled
return TRUE;
}
- static function disableComponent($componentName) {
+ public static function disableComponent($componentName) {
$config = CRM_Core_Config::singleton();
if (!in_array($componentName, $config->enableComponents) ||
!array_key_exists($componentName, CRM_Core_Component::getComponents())
/**
* @return array
*/
- static function skipVars() {
+ public static function skipVars() {
return array(
'dsn',
'templateCompileDir',
);
}
}
-