cvs: php4 /pear/File Find.php
| From: | Thomas V.V.Cox | Date: | Tue, 21 Aug 2001 03:06:06 +0000 |
| Subject: | cvs: php4 /pear/File Find.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-608@lists.php.net to get a copy of this message | ||
cox Mon Aug 20 23:06:06 2001 EDT
Modified files:
/php4/pear/File Find.php
Log:
killed warning when no matches in glob
Index: php4/pear/File/Find.php
diff -u php4/pear/File/Find.php:1.15 php4/pear/File/Find.php:1.16
--- php4/pear/File/Find.php:1.15 Mon Aug 20 23:00:38 2001
+++ php4/pear/File/Find.php Mon Aug 20 23:06:06 2001
@@ -16,7 +16,7 @@
// | Authors: Sterling Hughes <sterling@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Find.php,v 1.15 2001/08/21 03:00:38 cox Exp $
+// $Id: Find.php,v 1.16 2001/08/21 03:06:06 cox Exp $
//
require_once 'PEAR.php';
@@ -25,7 +25,7 @@
* Commonly needed functions searching directory trees
*
* @access public
-* @version $Id: Find.php,v 1.15 2001/08/21 03:00:38 cox Exp $
+* @version $Id: Find.php,v 1.16 2001/08/21 03:06:06 cox Exp $
* @package File
* @author Sterling Hughes <sterling@php.net>
*/
@@ -62,7 +62,7 @@
* 'perl').
*
* @return array containing all of the files and directories
- * matching the pattern.
+ * matching the pattern or null if no matches
*
* @author Sterling Hughes <sterling@php.net>
* @access public
@@ -77,7 +77,7 @@
}
$match_function = File_Find::_determineRegex ($pattern, $pattern_type);
-
+ $matches = array();
while ($entry = @readdir ($dh))
{
if ($match_function ($pattern, $entry) &&
@@ -88,7 +88,7 @@
}
@closedir ($dh);
- return ($matches);
+ return (sizeof($matches) > 0) ? $matches : null;
}
/**