cvs: php4 /pear/PEAR Common.php
| From: | Thomas V.V.Cox | Date: | Thu, 19 Jul 2001 10:32:06 +0000 |
| Subject: | cvs: php4 /pear/PEAR Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-299@lists.php.net to get a copy of this message | ||
cox Thu Jul 19 06:32:06 2001 EDT
Modified files:
/php4/pear/PEAR Common.php
Log:
added TODO and checks before try to open the package.xml file
Index: php4/pear/PEAR/Common.php
diff -u php4/pear/PEAR/Common.php:1.5 php4/pear/PEAR/Common.php:1.6
--- php4/pear/PEAR/Common.php:1.5 Wed Jul 18 13:11:28 2001
+++ php4/pear/PEAR/Common.php Thu Jul 19 06:32:06 2001
@@ -17,9 +17,17 @@
// | |
// +----------------------------------------------------------------------+
//
+// $Id: Common.php,v 1.6 2001/07/19 10:32:06 cox Exp $
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 @@
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');