need to consider caching when applying setup operations

This commit is contained in:
Ralf Becker 2014-04-16 17:57:44 +00:00
parent 20db2d8c81
commit 3b68b8bff8
3 changed files with 18 additions and 0 deletions

View File

@ -568,6 +568,15 @@ class egw_cache
return $ret;
}
/**
* Unset instance key, so it get read again and re-read install_id from database
*/
static public function unset_instance_key()
{
self::$instance_key = null;
$GLOBALS['egw_info']['server']['install_id'] = egw_cache::get_system_config('install_id', false);
}
/**
* Key used for instance specific data
*

View File

@ -138,6 +138,9 @@ abstract class setup_cmd extends admin_cmd
{
$GLOBALS['egw']->db->disconnect();
$GLOBALS['egw']->db = new egw_db($GLOBALS['egw_domain'][$domain]);
// change caching to managed instance
egw_cache::unset_instance_key();
}
}
@ -152,6 +155,9 @@ abstract class setup_cmd extends admin_cmd
$GLOBALS['egw']->db->disconnect();
$GLOBALS['egw']->db = new egw_db($GLOBALS['egw_info']['server']);
// change caching back to own instance
egw_cache::unset_instance_key();
if (!is_null(self::$egw_accounts_backup))
{
$GLOBALS['egw']->accounts = self::$egw_accounts_backup;

View File

@ -93,6 +93,9 @@ class setup_cmd_config extends setup_cmd
{
if ($save_mail_account) $this->_save_mail_account($values);
// flush instance cache, so above config get read from database not cache
egw_cache::flush();
$this->restore_db();
return lang('Configuration changed.');