fixed serveral issues around cached config:

- changing config in setup did not update or unset the cache --> instance was NOT using it
- new installs failed, because cache was not configured
- cache command to not configured cache gave fatal error, now they throw a (catchable) exception
This commit is contained in:
Ralf Becker 2011-09-13 09:25:25 +00:00
parent d52c72207c
commit 2ed73047df
4 changed files with 19 additions and 4 deletions

View File

@ -93,7 +93,8 @@ class config
{
if (!isset($this->config_data[$name])) // has been deleted
{
self::$db->delete(config::TABLE,array('config_app'=>$this->appname,'config_name'=>$name),__LINE__,__FILE__);
$this->save_value($name,null,null,false);
//self::$db->delete(config::TABLE,array('config_app'=>$this->appname,'config_name'=>$name),__LINE__,__FILE__);
}
}
self::$db->unlock();

View File

@ -460,10 +460,17 @@ class egw_cache
{
$db = $GLOBALS['egw']->db ? $GLOBALS['egw']->db : $GLOBALS['egw_setup']->db;
$GLOBALS['egw_info']['server'][$name] = $db->select(config::TABLE,'config_value',array(
if (($rs = $db->select(config::TABLE,'config_value',array(
'config_app' => 'phpgwapi',
'config_name' => $name,
),__LINE__,__FILE__)->fetchColumn();
),__LINE__,__FILE__)))
{
$GLOBALS['egw_info']['server'][$name] = $rs->fetchColumn();
}
else
{
error_log(__METHOD__."('name', $throw) cound NOT query value!");
}
}
if (!$GLOBALS['egw_info']['server'][$name] && $throw)
{

View File

@ -104,6 +104,8 @@ if(@get_var('submit',Array('POST')) && @$newsettings)
if(!$GLOBALS['error'])
{
$GLOBALS['egw_setup']->db->transaction_commit();
// unset cached config, as this is the primary source for configuration now
egw_cache::unsetInstance('config', 'configs');
Header('Location: index.php');
exit;

View File

@ -62,7 +62,12 @@ class setup_process
$GLOBALS['egw_setup']->oProc = new schema_proc();
// delete image-map, in case new apps get installed, or existing ones updated
common::delete_image_map();
try {
common::delete_image_map();
}
catch(Exception $e) {
// ignore exception, as during a new install, there's no cache configured and therefore no need to unset
}
}
/**