Skip to content

Commit

Permalink
Backport Settings API from 4.3
Browse files Browse the repository at this point in the history
Settings backport part 2 settings hooks

more settings backport - findfiles function

settings backport hook handling

another backport of settings

Update settings from 4.3 version

update settings code (also in 4.3)
  • Loading branch information
eileenmcnaughton committed Feb 25, 2013
1 parent 1c06d1e commit 49335f0
Show file tree
Hide file tree
Showing 18 changed files with 2,524 additions and 71 deletions.
19 changes: 16 additions & 3 deletions CRM/Core/BAO/ConfigSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@
*/
class CRM_Core_BAO_ConfigSetting {

/**
* Function to create civicrm settings. This is the same as add but it clears the cache and reloads the config object
*
* @params array $params associated array of civicrm variables
*
* @return null
* @static
*/
static function create($params) {
self::add($params);
$cache = CRM_Utils_Cache::singleton();
$cache->delete('CRM_Core_Config');
$config = CRM_Core_Config::singleton(TRUE, TRUE);
}

/**
* Function to add civicrm settings
*
Expand Down Expand Up @@ -202,9 +217,7 @@ static function retrieve(&$defaults) {
$domain->find(TRUE);
if ($domain->config_backend) {
$defaults = unserialize($domain->config_backend);
if ($defaults === FALSE ||
!is_array($defaults)
) {
if ($defaults === FALSE || !is_array($defaults)) {
$defaults = array();
return;
}
Expand Down
Loading

0 comments on commit 49335f0

Please sign in to comment.