]> granicus.if.org Git - php/commitdiff
MFH bugfixes
authorGreg Beaver <cellog@php.net>
Sat, 12 Jun 2004 06:16:17 +0000 (06:16 +0000)
committerGreg Beaver <cellog@php.net>
Sat, 12 Jun 2004 06:16:17 +0000 (06:16 +0000)
pear/PEAR/Common.php

index 6e11a0d0276f8429c6de75a298af5b7924faf10d..2f9c6118234cdec41bd39cba83afdcf188c9fda8 100644 (file)
@@ -1076,7 +1076,7 @@ class PEAR_Common extends PEAR
         if (!isset($info['version'])) {
             $errors[] = 'missing version';
         } elseif (!$this->validPackageVersion($info['version'])) {
-            $errors[] = 'invalid package version';
+            $errors[] = 'invalid package release version';
         }
         if (empty($info['release_state'])) {
             $errors[] = 'missing release state';
@@ -1115,24 +1115,24 @@ class PEAR_Common extends PEAR
                 $i++;
             }
         }
-        if (!empty($info['deps'])) {
+        if (!empty($info['release_deps'])) {
             $i = 1;
-            foreach ($info['deps'] as $d) {
+            foreach ($info['release_deps'] as $d) {
                 if (empty($d['type'])) {
                     $errors[] = "dependency $i: missing type";
                 } elseif (!in_array($d['type'], PEAR_Common::getDependencyTypes())) {
-                    $errors[] = "dependency $i: invalid type, should be one of: " .
+                    $errors[] = "dependency $i: invalid type '$d[type]', should be one of: " .
                         implode(' ', PEAR_Common::getDependencyTypes());
                 }
                 if (empty($d['rel'])) {
                     $errors[] = "dependency $i: missing relation";
                 } elseif (!in_array($d['rel'], PEAR_Common::getDependencyRelations())) {
-                    $errors[] = "dependency $i: invalid relation, should be one of: "
+                    $errors[] = "dependency $i: invalid relation '$d[rel]', should be one of: "
                         . implode(' ', PEAR_Common::getDependencyRelations());
                 }
                 if (!empty($d['optional'])) {
                     if (!in_array($d['optional'], array('yes', 'no'))) {
-                        $errors[] = "dependency $i: invalid relation optional attribute, should be one of: yes no";
+                        $errors[] = "dependency $i: invalid relation optional attribute '$d[optional]', should be one of: yes no";
                     }
                 }
                 if ($d['rel'] != 'has' && empty($d['version'])) {
@@ -1407,7 +1407,7 @@ class PEAR_Common extends PEAR
                     }
                     continue 2;
                 case T_DOUBLE_COLON:
-                    if ($tokens[$i - 1][0] != T_STRING) {
+                    if (!($tokens[$i - 1][0] == T_WHITESPACE || $tokens[$i - 1][0] == T_STRING)) {
                         PEAR::raiseError("Parser error: Invalid PHP file $file",
                             PEAR_COMMON_ERROR_INVALIDPHP);
                         return false;