Hi Arnold, On 3/6/07, Arnold Daniels <[EMAIL PROTECTED]> wrote:
Hi, I've started this discussion, but did not participate (cause I was ill). I like the glob:// implementation, it solves my problems as developer
The problem is not how glob is implemented (nothing changed here) but the glob:// URI. The glob implementation is either the system one or the version available in windows/glob.*
Another problem with implementing glob like behavior in each stream implementation is that it breaks compatibility, potentially even causing security problems. Example: $filename = basename($_FILES['userfile']['name']); $zip = new ZipArchive(); $zip->open('my.zip', ZIPARCHIVE::CREATE); $zip->addFile($_FILES['userfile']['tmp_name'], $filename); $zip->close(); readfile("zip://my.zip/$filename"); This would give an unexpected result if the filename would be "is this ok?.doc"
What are you suggesting? What does that have to do with glob? Are you suggesting that zip will automatically add files using blog pattern? Zip has special methods to add file from pattern or glob, addGlob and addPattern: http://blog.thepimp.net/index.php/post/2007/01/18/Finally-some-new-features-are-coming-zip-190-serie-began The problem is to have fnmatch available on each platform and portable (behaves the same on all platform), not to add some weird URI like glob://, it does not solve the portability issues and add more confusions to the URI mess.
In the future perhaps it would be nice to specify the streams like subversion does, eg: 'zip+glob://mydir/*.jpg'. Than the following might also be possible: 'ftp+zip://...'. However for now, this is beyond the scope of php stream and therefore I'm extremely happy with the glob implementation as provided by Marcus.
The glob:// URI is wrong per nature as it is not a URI resource but a filter.Please try to understand my point of view, the idea of adding glob/fnmatch op in stream is obviously good but not the glob:// URI. --Pierre -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php