mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-03 12:00:09 +01:00
Check only for apps tables, not any tables
This commit is contained in:
parent
7d6177d17f
commit
901956a477
@ -185,13 +185,27 @@
|
|||||||
// $phpgw_schema_proc = new phpgw_schema_proc($phpgw_domain[$ConfigDomain]["db_type"]);
|
// $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;$i<count($haystack) && $haystack[$i] !=$needle;$i++);
|
||||||
|
return ($i!=count($haystack));
|
||||||
|
}
|
||||||
|
|
||||||
function check_db()
|
function check_db()
|
||||||
{
|
{
|
||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
$this->db->Halt_On_Error = "no";
|
$this->db->Halt_On_Error = "no";
|
||||||
$tables = $this->db->table_names();
|
$tables = $this->db->table_names();
|
||||||
if (is_array($tables) && count($tables) > 0){
|
while(list($key,$val) = @each($tables))
|
||||||
/* tables exists. checking for post beta version */
|
{
|
||||||
|
$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");
|
$this->db->query("select * from phpgw_applications");
|
||||||
while (@$this->db->next_record()) {
|
while (@$this->db->next_record()) {
|
||||||
if ($this->db->f("app_name") == "admin"){$phpgw_info["setup"]["oldver"]["phpgwapi"] = $this->db->f("app_version");}
|
if ($this->db->f("app_name") == "admin"){$phpgw_info["setup"]["oldver"]["phpgwapi"] = $this->db->f("app_version");}
|
||||||
|
Loading…
Reference in New Issue
Block a user