diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index 1373db40bb..555ba77443 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -117,14 +117,17 @@ class egw extends egw_minimal } exit; } - // Set the DB's client charset if a system-charset is set - $system_charset = $GLOBALS['egw_info']['server']['system_charset'] = $this->db->select(config::TABLE,'config_value',array( + // Set the DB's client charset if a system-charset is set and some other values needed by egw_cache (used in config::read) + foreach($GLOBALS['egw_info']['server']['system_charset'] = $this->db->select(config::TABLE,'config_name,config_value',array( 'config_app' => 'phpgwapi', - 'config_name' => 'system_charset', - ),__LINE__,__FILE__)->fetchColumn(); - if ($system_charset) + 'config_name' => array('system_charset','install_id','temp_dir'), + ),__LINE__,__FILE__) as $row) { - $this->db->Link_ID->SetCharSet($system_charset); + $GLOBALS['egw_info']['server'][$row['config_name']] = $row['config_value']; + } + if ($GLOBALS['egw_info']['server']['system_charset']) + { + $this->db->Link_ID->SetCharSet($GLOBALS['egw_info']['server']['system_charset']); } // load up the $GLOBALS['egw_info']['server'] array $GLOBALS['egw_info']['server'] += config::read('phpgwapi'); diff --git a/phpgwapi/inc/class.egw_cache.inc.php b/phpgwapi/inc/class.egw_cache.inc.php index b23ad11c3c..c669f639da 100644 --- a/phpgwapi/inc/class.egw_cache.inc.php +++ b/phpgwapi/inc/class.egw_cache.inc.php @@ -452,7 +452,7 @@ class egw_cache * @param boolean $throw=true throw an exception, if we can't retriev the value * @return string|boolean string with config or false if not found and !$throw */ - static protected function get_system_config($name,$throw=true) + static public function get_system_config($name,$throw=true) { if(!isset($GLOBALS['egw_info']['server'][$name])) { diff --git a/phpgwapi/inc/class.egw_cache_files.inc.php b/phpgwapi/inc/class.egw_cache_files.inc.php index 97353f0cbe..7fc1161a52 100644 --- a/phpgwapi/inc/class.egw_cache_files.inc.php +++ b/phpgwapi/inc/class.egw_cache_files.inc.php @@ -45,21 +45,7 @@ class egw_cache_files implements egw_cache_provider } else { - if(!isset($GLOBALS['egw_info']['server']['temp_dir'])) - { - if (isset($GLOBALS['egw_setup']) && isset($GLOBALS['egw_setup']->db)) - { - $GLOBALS['egw_info']['server']['temp_dir'] = $GLOBALS['egw_setup']->db->select(config::TABLE,'config_value',array( - 'config_app' => 'phpgwapi', - 'config_name' => 'temp_dir', - ),__LINE__,__FILE__)->fetchColumn(); - } - if (!$GLOBALS['egw_info']['server']['temp_dir']) - { - throw new Exception (__METHOD__."() server/temp_dir is NOT set!"); - } - } - $this->base_path = $GLOBALS['egw_info']['server']['temp_dir'].'/egw_cache'; + $this->base_path = egw_cache::get_system_config('temp_dir').'/egw_cache'; } if (!isset($this->base_path) || !file_exists($this->base_path) && !mkdir($this->base_path,0700,true)) {