cvs: php4 /pear/File Find.php
| From: | Mika Tuupola | Date: | Mon, 29 Apr 2002 12:27:06 +0000 |
| Subject: | cvs: php4 /pear/File Find.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3625@lists.php.net to get a copy of this message | ||
tuupola Mon Apr 29 08:27:06 2002 EDT
Modified files:
/php4/pear/File Find.php
Log:
* fixed the maxrecursion in mapTreeMultiple()
# this fix was found in readdir() comments in php manual
Index: php4/pear/File/Find.php
diff -u php4/pear/File/Find.php:1.25 php4/pear/File/Find.php:1.26
--- php4/pear/File/Find.php:1.25 Tue Apr 23 10:45:08 2002
+++ php4/pear/File/Find.php Mon Apr 29 08:27:06 2002
@@ -16,7 +16,7 @@
// | Author: Sterling Hughes <sterling@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Find.php,v 1.25 2002/04/23 14:45:08 tuupola Exp $
+// $Id: Find.php,v 1.26 2002/04/29 12:27:06 tuupola Exp $
//
require_once 'PEAR.php';
@@ -25,7 +25,7 @@
* Commonly needed functions searching directory trees
*
* @access public
-* @version $Id: Find.php,v 1.25 2002/04/23 14:45:08 tuupola Exp $
+* @version $Id: Find.php,v 1.26 2002/04/29 12:27:06 tuupola Exp $
* @package File
* @author Sterling Hughes <sterling@php.net>
*/
@@ -141,12 +141,11 @@
* @access public
*/
- function &mapTreeMultiple($directory, $maxrecursion=0)
+ function &mapTreeMultiple($directory, $maxrecursion=0, $count=0)
{
$retval = array();
- static $count = 0;
$count++;
$directory .= '/';
@@ -167,7 +166,8 @@
if (is_dir($path)) {
unset($retval[$key]);
if ($maxrecursion == 0 || $count < $maxrecursion) {
- $retval[$val] = File_Find::mapTreeMultiple($path, $maxrecursion);
+ $retval[$val] = File_Find::mapTreeMultiple($path,
+ $maxrecursion, $count);
}
}
}