Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.3

Bug #2132 Doc state &search() can be called statically. It isn't true.
Submitted: 2004-08-16 11:02 UTC
From: techtonik at tut dot by Assigned: tuupola
Status: Closed Package: File_Find
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    

 [2004-08-16 11:02 UTC] techtonik at tut dot by
Description: ------------ In documentation notes about function &search ($pattern, $directory, $type='php'); -- Note This function can be called statically. -- It could't, because it uses other methods of the class, which in turn working with $this object instance. Here is a patch for that. Expected result: ---------------- --- C:\httpd\.PHP\PEAR\File\Find.php.old Mon Aug 16 13:59:22 2004 +++ C:\httpd\.PHP\PEAR\File\Find.php Mon Aug 16 13:40:12 2004 @@ -194,6 +194,13 @@ * @access public */ function &search ($pattern, $directory, $type='php') { + + // if called statically + if (!isset($this)) { + $obj = &new File_Find(); + return $obj->search($pattern, $directory, $type); + } + $matches = array(); list (,$files) = File_Find::maptree($directory); $match_function = File_Find::_determineRegex($pattern, $type);


 [2004-08-18 10:36 UTC] tuupola
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on In case this was a website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.