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

Bug #5503 shell matching not working as expected?
Submitted: 2005-09-23 16:01 UTC
From: merrittd at dhcmc dot com Assigned: techtonik
Status: Closed Package: File_Find
PHP Version: 5.0.5 OS: Win 2000 SP4
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 : 29 + 40 = ?

 
 [2005-09-23 16:01 UTC] merrittd at dhcmc dot com
Description: ------------ Not sure the shell pattern matching is working as expected. See the test script for a full description. Using File_Find 1.1.0 w/ PEAR 1.4.0 on PHP 5.0.5 Test script: --------------- <?php // have a directory of files: // // Copy of FileZilla Server.xml // FileZilla Server.xml // FileZilla Server.xml.2005_09_22_091500 // FileZilla Server.xml.2005_09_22_001500 // FileZilla Server.xml.2005_09_21_124500 // etc // // Matching 'FileZilla Server.xml.*' require_once('File/Find.php'); $Match = 'FileZilla Server.xml' . '.*'; echo "Matching $Match\n"; $OldFiles = &File_Find::glob( $Match, '.', 'shell' ); print_r($OldFiles); ?> Expected result: ---------------- FileZilla Server.xml.2005_09_22_091500 FileZilla Server.xml.2005_09_22_001500 FileZilla Server.xml.2005_09_21_124500 etc Actual result: -------------- Copy of FileZilla Server.xml FileZilla Server.xml FileZilla Server.xml.2005_09_22_091500 FileZilla Server.xml.2005_09_22_001500 FileZilla Server.xml.2005_09_21_124500 etc

Comments

 [2006-02-11 16:42 UTC] techtonik
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. New 'shell' match method is appeared in File_Find version 1.2.0, but even in version 1.2.1 there are some bugs, that doesn't make it work as you expect. I've fixed these bugs and hope to wrap a new release soon. But to match all files with 'two' extensions you will have to use different mask: $Match = 'FileZilla Server.xml' . '.*.'; instead of $Match = 'FileZilla Server.xml' . '.*'; because 'FileZilla Server.xml.*' means 'with any additional extension or no extension at all'. And this behavior is intentional.
 [2006-02-18 11:36 UTC] techtonik
Try freshly released 1.2.2 http://pear.php.net/package/File_Find/