]> granicus.if.org Git - php/commitdiff
added TODO and checks before try to open the package.xml file
authorTomas V.V.Cox <cox@php.net>
Thu, 19 Jul 2001 10:32:06 +0000 (10:32 +0000)
committerTomas V.V.Cox <cox@php.net>
Thu, 19 Jul 2001 10:32:06 +0000 (10:32 +0000)
pear/PEAR/Common.php

index 50d37e3aeff2c36b4efac80093cbd8dbe6b01484..460e210838f455874a54761e4b5479f331c1ce61 100644 (file)
 // |                                                                      |
 // +----------------------------------------------------------------------+
 //
+// $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');