self::add($params);
$cache = CRM_Utils_Cache::singleton();
$cache->delete('CRM_Core_Config');
+ $cache->delete('CRM_Core_Config' . CRM_Core_Config::domainID());
$config = CRM_Core_Config::singleton(TRUE, TRUE);
}
* @access public
*/
static function getItems(&$params, $domains = null, $settingsToReturn) {
+ $originalDomain = CRM_Core_Config::domainID();
if (empty($domains)) {
- $domains[] = CRM_Core_Config::domainID();
+ $domains[] = $originalDomain;
}
if (!empty($settingsToReturn) && !is_array($settingsToReturn)) {
$settingsToReturn = array($settingsToReturn);
}
- $config = CRM_Core_Config::singleton();
+ $reloadConfig = FALSE;
+
$fields = $result = array();
$fieldsToGet = self::validateSettingsInput(array_flip($settingsToReturn), $fields, FALSE);
foreach ($domains as $domain) {
+ CRM_Core_BAO_Domain::setDomain($domain);
+ if($domain != $originalDomain){
+ $reloadConfig = TRUE;
+ }
+ $config = CRM_Core_Config::singleton($reloadConfig, $reloadConfig);
$result[$domain] = array();
foreach ($fieldsToGet as $name => $value) {
if(!empty($fields['values'][$name]['prefetch'])){
// e.g for revert of fill actions
$result[$domain][$name] = $setting;
}
+ CRM_Core_BAO_Domain::resetDomain();
}
}
return $result;
// first, attempt to get configuration object from cache
$cache = CRM_Utils_Cache::singleton();
- self::$_singleton = $cache->get('CRM_Core_Config');
-
+ self::$_singleton = $cache->get('CRM_Core_Config' . CRM_Core_Config::domainID());
// if not in cache, fire off config construction
if (!self::$_singleton) {
self::$_singleton = new CRM_Core_Config;
// retrieve and overwrite stuff from the settings file
self::$_singleton->setCoreVariables();
}
- $cache->set('CRM_Core_Config', self::$_singleton);
+ $cache->set('CRM_Core_Config' . CRM_Core_Config::domainID(), self::$_singleton);
}
else {
// we retrieve the object from memcache, so we now initialize the objects
$config = &CRM_Core_Config::singleton();
$cache = &CRM_Utils_Cache::singleton();
-$cache->set('CRM_Core_Config', $config);
-CRM_Core_Error::debug('get', $cache->get('CRM_Core_Config'));
+$cache->set('CRM_Core_Config' .CRM_Core_Config::domainID(), $config);
+CRM_Core_Error::debug('get', $cache->get('CRM_Core_Config' . CRM_Core_Config::domainID()));