]> granicus.if.org Git - php/commitdiff
Updating the PHP_4_3 branch with the fix for bug #2306.
authorJesus M. Castagnetto <jmcastagnetto@php.net>
Mon, 14 Apr 2003 12:37:59 +0000 (12:37 +0000)
committerJesus M. Castagnetto <jmcastagnetto@php.net>
Mon, 14 Apr 2003 12:37:59 +0000 (12:37 +0000)
pear/PEAR/Dependency.php

index b33dcd9054cdba46ba16d0140b211c118e34380a..22173ce6257442e838ad308c30ff472316cb2ee1 100644 (file)
@@ -199,14 +199,15 @@ class PEAR_Dependency
      */
     function checkPHP(&$errmsg, $req, $relation = 'ge')
     {
-        if (substr($relation, 0, 2) == 'v.') {
-            $php_ver = phpversion();
-            $operator = substr($relation, 2);
-            if (!version_compare("$php_ver", "$req", $operator)) {
-                $errmsg = "PHP version " . $this->signOperator($operator) .
-                    " $req is required";
-                return PEAR_DEPENDENCY_CONFLICT;
-            }
+        if (substr($req, 0, 2) == 'v.') {
+            $req = substr($req,2, strlen($req) - 2);
+        }
+        $php_ver = phpversion();
+        $operator = substr($relation,0,2);
+        if (!version_compare("$php_ver", "$req", $operator)) {
+            $errmsg = "PHP version " . $this->signOperator($operator) .
+                " $req is required";
+            return PEAR_DEPENDENCY_CONFLICT;
         }
         return false;
     }
@@ -271,14 +272,15 @@ class PEAR_Dependency
      */
     function checkZend(&$errmsg, $req, $relation = 'ge')
     {
-        if (substr($relation, 0, 2) == 'v.') {
-            $zend_ver = zend_version();
-            $operator = substr($relation, 2);
-            if (!version_compare("$zend_ver", "$req", $operator)) {
-                $errmsg = "Zend version " . $this->signOperator($operator) .
-                    " $req is required";
-                return PEAR_DEPENDENCY_CONFLICT;
-            }
+        if (substr($req, 0, 2) == 'v.') {
+            $req = substr($req,2, strlen($req) - 2);
+        }
+        $zend_ver = zend_version();
+        $operator = substr($relation,0,2);
+        if (!version_compare("$zend_ver", "$req", $operator)) {
+            $errmsg = "Zend version " . $this->signOperator($operator) .
+                " $req is required";
+            return PEAR_DEPENDENCY_CONFLICT;
         }
         return false;
     }