diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index 9db4d0d741..9d0b0d2430 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -84,25 +84,20 @@ class egw extends egw_minimal // check if eGW is already setup, if not redirect to setup/ try { $this->db->connect(); + if (!($num_config = $this->db->select(config::TABLE,'COUNT(config_name)',false,__LINE__,__FILE__)->fetchSingle())) + { + $phpgw_config = $this->db->select('phpgw_config','COUNT(config_name)',false,__LINE__,__FILE__)->fetchSingle(); + } } catch(Exception $e) { //echo "
Connection to DB failed (".$e->getMessage().")!\n".$e->getTraceAsString(); } - $buff = $this->db->Halt_On_Error; - $this->db->Halt_On_Error = "report"; - $retval=false; - if (is_object($this->db->select(config::TABLE,'COUNT(config_name)',false,__LINE__,__FILE__))) { - $retval = $this->db->select(config::TABLE,'COUNT(config_name)',false,__LINE__,__FILE__)->fetchSingle(); - } else { - #echo config::TABLE. " does not exist"; - } - if ($e || !$retval) + if ($e || !$num_config) { - $setup_dir = str_replace($_SERVER['PHP_SELF'],'index.php','setup/'); + $setup_dir = str_replace(array('home/index.php','index.php'),'setup/',$_SERVER['PHP_SELF']); // we check for the old table too, to not scare updating users ;-) - if (!$e && is_object($this->db->select('phpgw_config','COUNT(config_name)',false,__LINE__,__FILE__)) && - $this->db->select('phpgw_config','COUNT(config_name)',false,__LINE__,__FILE__)->fetchSingle()) + if ($phpgw_config) { throw new Exception('Fatal Error: You need to update eGroupWare before you can continue using it. ',999); @@ -114,7 +109,6 @@ class egw extends egw_minimal } exit; } - $this->db->Halt_On_Error = $buff; // Set the DB's client charset if a system-charset is set $system_charset = $this->db->select(config::TABLE,'config_value',array( 'config_app' => 'phpgwapi',