added code for getting apps status in terms of the version

This commit is contained in:
seek3r 2001-01-06 10:03:03 +00:00
parent 82c5aac5de
commit 3504b92187
3 changed files with 50 additions and 8 deletions

18
phpgwapi/version.inc.php Normal file
View File

@ -0,0 +1,18 @@
<?php
/**************************************************************************\
* phpGroupWare *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/*
This is a completely redundant file, but Im keeping it here because
I have some irrational feeling that I should. Seek3r
*/
//$phpgw_info["server"]["versions"]["phpgwapi"] = $phpgw_info["server"]["versions"]["phpgwapi"];

View File

@ -308,21 +308,44 @@
}
$d->close();
}
function app_status($appname = ""){
global $phpgw_info;
$this->execute_script("version");
reset ($phpgw_info["server"]["versions"]);
$this->db->query("select * from applications");
while ($this->db->next_record()){
$phpgw_info["server"]["current_versions"][$this->db->f("app_name")] = $this->db->f("app_version");
}
while (list($key, $value) = each ($phpgw_info["server"]["versions"])){
if ($key != "header" && $key != "current_header" && $key != "" && $key != "mcrypt"){
if (!isset($phpgw_info["server"]["current_versions"][$key])){
$phpgw_info["server"]["current_versions"][$key] = "new";
$phpgw_info["setup"][$key]["status"] = "new";
}elseif ($value != $phpgw_info["server"]["current_versions"][$key]){
$phpgw_info["setup"][$key]["status"] = "upgrade";
}else{
$phpgw_info["setup"][$key]["status"] = "current";
}
echo "phpgw_info[setup][$key][status]: ".$phpgw_info["setup"][$key]["status"]."<br>";
}
}
}
function execute_script($script, $appname = ""){
global $phpgw_info, $phpgw_domain;
if ($appname == ""){
$d = dir($phpgw_info["server"]["server_root"]);
while($entry=$d->read()) {
$f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/version.inc.php";
if (file_exists ($f)){
include($f);
if ($script == "version"){
$f = $phpgw_info["server"]["server_root"]."/".$entry."/version.inc.php";
if (file_exists ($f)){include($f); }
}else{
$phpgw_info["server"]["versions"][$entry] = $phpgw_info["setup"]["currentver"]["phpgwapi"];
$f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/".$script.".inc.php";
if (file_exists ($f)){include($f);}
}
$f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/".$script.".inc.php";
if (file_exists ($f)){include($f);}
}
$d->close();
}else{
@ -337,7 +360,7 @@
$this->db->query("update applications set app_version='".$phpgw_info["setup"]["currentver"]["phpgwapi"]."' where app_name='".$appname."'");
}
function manage_tables(){
function manage_tables($appname=""){
global $phpgw_domain, $phpgw_info;
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "drop"){
$this->execute_script("droptables");

View File

@ -65,6 +65,7 @@
exit;
}
//$phpgw_setup->app_status();
$phpgw_info["server"]["app_images"] = "templates/default/images";
echo "<table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">";