cvs: pear-core(PEAR_1_4) /PEAR PackageFile.php
| From: | Pierre-Alain Joye | Date: | Thu, 08 Jun 2006 00:04:13 +0000 |
| Subject: | cvs: pear-core(PEAR_1_4) /PEAR PackageFile.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-4773@lists.php.net to get a copy of this message | ||
pajoye Thu Jun 8 00:04:13 2006 UTC
Modified files: (Branch: PEAR_1_4)
/pear-core/PEAR PackageFile.php
Log:
- #7830, fromAnyFile expects a file. 1.5 will allow directory (1.4.x is
is for bug fixes only)
http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/PackageFile.php?r1=1.33&r2=1.33.2.1&diff_format=u
Index: pear-core/PEAR/PackageFile.php
diff -u pear-core/PEAR/PackageFile.php:1.33 pear-core/PEAR/PackageFile.php:1.33.2.1
--- pear-core/PEAR/PackageFile.php:1.33 Thu Feb 9 22:39:32 2006
+++ pear-core/PEAR/PackageFile.php Thu Jun 8 00:04:13 2006
@@ -15,7 +15,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: PackageFile.php,v 1.33 2006/02/09 22:39:32 cellog Exp $
+ * @version CVS: $Id: PackageFile.php,v 1.33.2.1 2006/06/08 00:04:13 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -404,6 +404,11 @@
*/
function &fromAnyFile($info, $state)
{
+ if (is_dir($info)) {
+ $info = PEAR::raiseError("'$info' is a directory, a file is expected");
+ return $info;
+ }
+
$fp = false;
if (is_string($info) && strlen($info) < 255 &&
(file_exists($info) || ($fp = @fopen($info, 'r')))) {
@@ -433,4 +438,4 @@
}
}
-?>
\ No newline at end of file
+?>