diff options
| author | Stig Bakken <ssb@php.net> | 2002-11-26 01:38:48 +0000 | 
|---|---|---|
| committer | Stig Bakken <ssb@php.net> | 2002-11-26 01:38:48 +0000 | 
| commit | 693204265e3970c58932aef21fb4d25e3f1ea1fd (patch) | |
| tree | 8b6987317d18e92a281bfd18319b0bf58e5f8952 | |
| parent | ad2618b8ebd8da9a3b2b2b576cb43b72cb4342bf (diff) | |
| download | php-git-693204265e3970c58932aef21fb4d25e3f1ea1fd.tar.gz | |
* a little more "windows robust" when looking for package.xml
| -rw-r--r-- | pear/PEAR/Common.php | 10 | 
1 files changed, 6 insertions, 4 deletions
diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index eeabe3c0a5..3087e95ca9 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -696,26 +696,28 @@ class PEAR_Common extends PEAR      function infoFromTgzFile($file)      {          if (!@is_file($file)) { -            return $this->raiseError("tgz :: could not open file \"$file\""); +            return $this->raiseError("could not open file \"$file\"");          }          $tar = new Archive_Tar($file);          $content = $tar->listContent();          if (!is_array($content)) { -            return $this->raiseError("tgz :: could not get contents of package \"$file\""); +            return $this->raiseError("could not get contents of package \"$file\"");          }          $xml = null;          foreach ($content as $file) {              $name = $file['filename'];              if ($name == 'package.xml') {                  $xml = $name; -            } elseif (ereg('^.*/package.xml$', $name, $match)) { +                break; +            } elseif (ereg('package.xml$', $name, $match)) {                  $xml = $match[0]; +                break;              }          }          $tmpdir = System::mkTemp('-d pear');          $this->addTempFile($tmpdir);          if (!$xml || !$tar->extractList($xml, $tmpdir)) { -            return $this->raiseError('tgz :: could not extract the package.xml file'); +            return $this->raiseError('could not extract the package.xml file');          }          return $this->infoFromDescriptionFile("$tmpdir/$xml");      }  | 
