From 901956a477413acbf17a901d46d6ccf9abf7f78d Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Thu, 12 Apr 2001 00:51:04 +0000 Subject: [PATCH] Check only for apps tables, not any tables --- setup/inc/phpgw_setup.inc.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/setup/inc/phpgw_setup.inc.php b/setup/inc/phpgw_setup.inc.php index b054797a19..7a3b395616 100644 --- a/setup/inc/phpgw_setup.inc.php +++ b/setup/inc/phpgw_setup.inc.php @@ -184,14 +184,28 @@ // $phpgw_schema_proc = new phpgw_schema_proc($phpgw_domain[$ConfigDomain]["db_type"]); } - + + // This is a php3/4 compliant in_array(), used only below in check_db() so far + function isinarray($needle,$haystack=array()) + { + for($i=0;$idb->Halt_On_Error = "no"; $tables = $this->db->table_names(); - if (is_array($tables) && count($tables) > 0){ - /* tables exists. checking for post beta version */ + while(list($key,$val) = @each($tables)) + { + $tname[] = $val['table_name']; + } + $newapps = $this->isinarray('phpgw_applications',$tname); + $oldapps = $this->isinarray('applications',$tname); + + if ( ( is_array($tables) ) && ( count($tables) > 0 ) && ( $newapps || $oldapps ) ){ + /* tables exist. checking for post beta version */ $this->db->query("select * from phpgw_applications"); while (@$this->db->next_record()) { if ($this->db->f("app_name") == "admin"){$phpgw_info["setup"]["oldver"]["phpgwapi"] = $this->db->f("app_version");}