From b25724e7ed72bb0f44df90bab302194a3ef88fea Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 13 May 2014 15:53:35 +0000 Subject: [PATCH] fixed setup uses cached config values for installs with multiple instances --- phpgwapi/inc/class.config.inc.php | 6 +++--- phpgwapi/inc/class.egw_cache.inc.php | 2 +- setup/inc/class.setup_process.inc.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/phpgwapi/inc/class.config.inc.php b/phpgwapi/inc/class.config.inc.php index fa113a48da..12b33e7e74 100755 --- a/phpgwapi/inc/class.config.inc.php +++ b/phpgwapi/inc/class.config.inc.php @@ -390,13 +390,13 @@ class config public static function init_static() { // we use a reference here (no clone), as we no longer use egw_db::row() or egw_db::next_record()! - if (is_object($GLOBALS['egw']->db)) + if (isset($GLOBALS['egw_setup']) && is_a($GLOBALS['egw_setup']->db, 'egw_db')) { - config::$db = $GLOBALS['egw']->db; + self::$db = $GLOBALS['egw_setup']->db; } else { - config::$db = $GLOBALS['egw_setup']->db; + self::$db = $GLOBALS['egw']->db; } // if item is not cached or cache is not looking alright --> query config from database if (!(self::$configs = egw_cache::getInstance(__CLASS__, 'configs')) || !is_array(self::$configs['phpgwapi'])) diff --git a/phpgwapi/inc/class.egw_cache.inc.php b/phpgwapi/inc/class.egw_cache.inc.php index 3112a471cc..bed9f12441 100644 --- a/phpgwapi/inc/class.egw_cache.inc.php +++ b/phpgwapi/inc/class.egw_cache.inc.php @@ -624,7 +624,7 @@ class egw_cache { static $bases = array(); - if (!isset($bases[$level])) + if (!isset($bases[$level]) || $level == self::INSTANCE && $bases[$level] != self::$instance_key) { switch($level) { diff --git a/setup/inc/class.setup_process.inc.php b/setup/inc/class.setup_process.inc.php index ca35d86787..b794ba70c3 100755 --- a/setup/inc/class.setup_process.inc.php +++ b/setup/inc/class.setup_process.inc.php @@ -123,7 +123,7 @@ class setup_process case 'new': /* Create tables and insert new records for each app in this list */ $passing = $this->current($pass,$DEBUG); - $this->save_minimal_config($preset_config); + if (isset($pass['phpgwapi'])) $this->save_minimal_config($preset_config); $passing = $this->default_records($passing,$DEBUG); break; case 'upgrade': @@ -297,7 +297,7 @@ class setup_process // so the default_records use the current data $GLOBALS['egw_info']['server'] = array_merge((array)$GLOBALS['egw_info']['server'], $current_config); - egw_cache::generate_instance_key(); // generate instance-key flushes whole instance cache + egw_cache::flush(); // flush whole instance cache config::init_static(); // flush internal cache of config class $GLOBALS['egw_setup']->setup_account_object($current_config); }