phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc class.setup_detection.inc.php clas...


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgwapi/inc class.setup_detection.inc.php clas...
Date: Tue, 15 Aug 2006 13:50:11 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Changes by:     Dave Hall <skwashd>     06/08/15 13:50:11

Modified files:
        inc            : class.setup_detection.inc.php 
                         class.setup.inc.php 

Log message:
        fix some E_NOTICES

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.setup_detection.inc.php?cvsroot=phpgwapi&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.setup.inc.php?cvsroot=phpgwapi&r1=1.24&r2=1.25

Patches:
Index: class.setup_detection.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/class.setup_detection.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- class.setup_detection.inc.php       22 Mar 2006 09:48:44 -0000      1.11
+++ class.setup_detection.inc.php       15 Aug 2006 13:50:10 -0000      1.12
@@ -7,7 +7,7 @@
        * @license http://www.fsf.org/licenses/gpl.html GNU General Public 
License
        * @package phpgwapi
        * @subpackage application
-       * @version $Id: class.setup_detection.inc.php,v 1.11 2006/03/22 
09:48:44 sigurdne Exp $
+       * @version $Id: class.setup_detection.inc.php,v 1.12 2006/08/15 
13:50:10 skwashd Exp $
        */
 
        /**
@@ -120,18 +120,21 @@
                        {
                                //echo '<br>'.$value['name'].'STATUS: 
'.$value['status'];
                                /* Only set this if it has not already failed 
to upgrade - Milosch */
-                               if(!( (@$value['status'] == 'F') || 
(@$value['status'] == 'C') ))
+                               if ( !isset($value['status']) || (! 
($value['status'] == 'F' || $value['status'] == 'C') ) )
                                {
                                        //if ($setup_info[$key]['currentver'] > 
$setup_info[$key]['version'])
-                                       
if($GLOBALS['phpgw_setup']->amorethanb($value['currentver'],@$value['version']))
+                                       if ( isset($value['currentver']) && 
isset($value['version'])
+                                               && 
$GLOBALS['phpgw_setup']->amorethanb($value['currentver'], $value['version']) )
                                        {
                                                $setup_info[$key]['status'] = 
'V';
                                        }
-                                       elseif(@$value['currentver'] == 
@$value['version'])
+                                       else if ( isset($value['currentver']) 
&& isset($value['version'])
+                                               && $value['currentver'] == 
$value['version'])
                                        {
                                                $setup_info[$key]['status'] = 
'C';
                                        }
-                                       
elseif($GLOBALS['phpgw_setup']->alessthanb(@$value['currentver'],@$value['version']))
+                                       else if ( isset($value['currentver']) 
&& isset($value['version'])
+                                               && 
$GLOBALS['phpgw_setup']->alessthanb($value['currentver'], $value['version']))
                                        {
                                                $setup_info[$key]['status'] = 
'U';
                                        }
@@ -169,9 +172,10 @@
                                                        }
                                                        else    // check if 
majors are equal and minors greater or equal
                                                        {
+                                                               //the @ is used 
below to work around some sloppy coding, we should not always assume version #s 
will be X.Y.Z.AAA
                                                                
$major_depsvalue = $GLOBALS['phpgw_setup']->get_major($depsvalue);
-                                                               
list(,,,$minor_depsvalue) = explode('.',$depsvalue);
-                                                               list(,,,$minor) 
= explode('.',$setup_info[$depsvalue['appname']]['currentver']);
+                                                               
@list(,,,$minor_depsvalue) = explode('.', $depsvalue);
+                                                               
@list(,,,$minor) = explode('.', 
$setup_info[$depsvalue['appname']]['currentver']);
                                                                if ($major == 
$major_depsvalue && $minor <= $minor_depsvalue)
                                                                {
                                                                        
$setup_info['depends'][$depkey]['status'] = True;

Index: class.setup.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/class.setup.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- class.setup.inc.php 18 Apr 2006 09:43:50 -0000      1.24
+++ class.setup.inc.php 15 Aug 2006 13:50:11 -0000      1.25
@@ -9,7 +9,7 @@
        * @license http://www.fsf.org/licenses/gpl.html GNU General Public 
License
        * @package phpgwapi
        * @subpackage application
-       * @version $Id: class.setup.inc.php,v 1.24 2006/04/18 09:43:50 sigurdne 
Exp $
+       * @version $Id: class.setup.inc.php,v 1.25 2006/08/15 13:50:11 skwashd 
Exp $
        */
 
        /**
@@ -711,12 +711,12 @@
                        $newa = ereg_replace('pre','.',$a);
                        $newb = ereg_replace('pre','.',$b);
                        $testa = explode('.',$newa);
-                       if($testa[3] == '')
+                       if( !isset($testa[3]) || $testa[3] == '')
                        {
                                $testa[3] = 0;
                        }
                        $testb = explode('.',$newb);
-                       if($testb[3] == '')
+                       if( !isset($testb[3]) || $testb[3] == '')
                        {
                                $testb[3] = 0;
                        }
@@ -724,8 +724,13 @@
 
                        for($i=0;$i<count($testa);$i++)
                        {
-                               if($DEBUG) { echo'<br>Checking if '. 
intval($testa[$i]) . ' is more than ' . intval($testb[$i]) . ' ...'; }
-                               if(intval($testa[$i]) > intval($testb[$i]))
+                               if($DEBUG)
+                               {
+                                       echo'<br>Checking if '. 
intval($testa[$i]) . ' is more than ' . intval($testb[$i]) . ' ...'; 
+                               }
+
+                               if ( isset($testa[$i]) &&  isset($testb[$i])
+                                       && (int)$testa[$i] > (int)$testb[$i] )
                                {
                                        if($DEBUG) { echo ' yes.'; }
                                        $less++;
@@ -737,7 +742,8 @@
                                                break;
                                        }
                                }
-                               elseif(intval($testa[$i]) < intval($testb[$i]))
+                               else if ( isset($testa[$i]) &&  
isset($testb[$i])
+                                       && (int)$testa[$i] < (int)$testb[$i] )
                                {
                                        if($DEBUG) { echo ' no.'; }
                                        $less--;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]