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)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 22 + 17 = ?

 
 [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);

Comments

 [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 pear.php.net. In case this was a pear.php.net 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.