mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-10 07:58:41 +01:00
"add system-charset to keys of tree-wide cache, if not utf-8, as content depends on charset!"
This commit is contained in:
parent
88d92e78f9
commit
132297a502
@ -440,6 +440,31 @@ class egw_cache
|
|||||||
return $providers[$level];
|
return $providers[$level];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a system configuration, even if in setup and it's not read
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
static protected function get_system_config($name)
|
||||||
|
{
|
||||||
|
if(!isset($GLOBALS['egw_info']['server'][$name]))
|
||||||
|
{
|
||||||
|
if (isset($GLOBALS['egw_setup']) && isset($GLOBALS['egw_setup']->db))
|
||||||
|
{
|
||||||
|
$GLOBALS['egw_info']['server'][$name] = $GLOBALS['egw_setup']->db->select(config::TABLE,'config_value',array(
|
||||||
|
'config_app' => 'phpgwapi',
|
||||||
|
'config_name' => $name,
|
||||||
|
),__LINE__,__FILE__)->fetchColumn();
|
||||||
|
}
|
||||||
|
if (!$GLOBALS['egw_info']['server'][$name])
|
||||||
|
{
|
||||||
|
throw new Exception (__METHOD__."($name) \$GLOBALS['egw_info']['server']['$name'] is NOT set!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $GLOBALS['egw_info']['server'][$name];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get keys array from $level, $app and $location
|
* Get keys array from $level, $app and $location
|
||||||
*
|
*
|
||||||
@ -458,23 +483,14 @@ class egw_cache
|
|||||||
{
|
{
|
||||||
case self::TREE:
|
case self::TREE:
|
||||||
$bases[$level] = $level.'-'.str_replace(array(':','/','\\'),'-',EGW_SERVER_ROOT);
|
$bases[$level] = $level.'-'.str_replace(array(':','/','\\'),'-',EGW_SERVER_ROOT);
|
||||||
|
// add charset to key, if not utf-8 (as everything we store depends on charset!)
|
||||||
|
if (($charset = self::get_system_config('system_charset')) && $charset != 'utf-8')
|
||||||
|
{
|
||||||
|
$bases[$level] .= '-'.$charset;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case self::INSTANCE:
|
case self::INSTANCE:
|
||||||
if(!isset($GLOBALS['egw_info']['server']['install_id']))
|
$bases[$level] = $level.'-'.self::get_system_config('install_id');
|
||||||
{
|
|
||||||
if (isset($GLOBALS['egw_setup']) && isset($GLOBALS['egw_setup']->db))
|
|
||||||
{
|
|
||||||
$GLOBALS['egw_info']['server']['install_id'] = $GLOBALS['egw_setup']->db->select(config::TABLE,'config_value',array(
|
|
||||||
'config_app' => 'phpgwapi',
|
|
||||||
'config_name' => 'install_id',
|
|
||||||
),__LINE__,__FILE__)->fetchColumn();
|
|
||||||
}
|
|
||||||
if (!$GLOBALS['egw_info']['server']['install_id'])
|
|
||||||
{
|
|
||||||
throw new Exception (__METHOD__."($level,$app,$location) server/install_id is NOT set!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$bases[$level] = $level.'-'.$GLOBALS['egw_info']['server']['install_id'];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user