diff options
author | Tomas V.V.Cox <cox@php.net> | 2001-07-19 10:32:06 +0000 |
---|---|---|
committer | Tomas V.V.Cox <cox@php.net> | 2001-07-19 10:32:06 +0000 |
commit | 0d629b854ad3eb8cca3ec974b66bd9b4c25c8a44 (patch) | |
tree | 0678d1fc7296cca95f1ecfe6748b1fa1b132388b /pear | |
parent | dfe15ad070efde477d39babc92ca2f8903daaf79 (diff) | |
download | php-git-0d629b854ad3eb8cca3ec974b66bd9b4c25c8a44.tar.gz |
added TODO and checks before try to open the package.xml file
Diffstat (limited to 'pear')
-rw-r--r-- | pear/PEAR/Common.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index 50d37e3aef..460e210838 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -17,9 +17,17 @@ // | | // +----------------------------------------------------------------------+ // +// $Id$ require_once 'PEAR.php'; +/** +* TODO: +* - check in inforFromDescFile that the minimal data needed is present +* (pack name, version, files, others?) +* - perhaps use parser folding to be less restrictive with the format + of the package.xml file +*/ class PEAR_Common extends PEAR { // {{{ properties @@ -247,7 +255,10 @@ class PEAR_Common extends PEAR function infoFromDescriptionFile($descfile) { - $fp = fopen($descfile, 'r'); + if (!is_file($descfile) || !is_readable($descfile) || + (!$fp = @fopen($descfile, 'r'))) { + return $this->raiseError("Unable to open $descfile"); + } $xp = @xml_parser_create(); if (!$xp) { return $this->raiseError('Unable to create XML parser'); |