Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28221 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36862 invoked by uid 1010); 4 Mar 2007 17:22:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36847 invoked from network); 4 Mar 2007 17:22:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2007 17:22:09 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.184.238 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 64.233.184.238 wr-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.184.238] ([64.233.184.238:61877] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/13-13031-F300BE54 for ; Sun, 04 Mar 2007 12:22:08 -0500 Received: by wr-out-0506.google.com with SMTP id i31so1193028wra for ; Sun, 04 Mar 2007 09:22:04 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=mkqfoQJFDub/u8ouvCkeijdmBYhXBKKD464//mYi/JT/IByv/LueIWo2du2h8dcrnDIByT/1bLBsu8Ed9XyvPVP5lfyaJjZyiDyXxzvIHGghyRIs5wqQTY8NNm8VwmBvkD+ilR/W7fZL/yd1gLhe4b50biTB47pYkwJup0kFlk0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DRO2U3L7E5o2OuqLPMajH8cMNRJ7C/4HS6H3BPxuaVANp1mX4WssJwreVqe0NtHuSwnoYjO7SoBlhE22dD9y1sGG1Ma0oTZZTJNx6VoGuzSLtqcSsEplSYkJ3tbIYY15lf5ddrpP5cfLR6CCh7WjljhNsKWFcTHi/p8gifJNpGI= Received: by 10.114.72.1 with SMTP id u1mr970461waa.1173028923772; Sun, 04 Mar 2007 09:22:03 -0800 (PST) Received: by 10.114.178.20 with HTTP; Sun, 4 Mar 2007 09:22:03 -0800 (PST) Message-ID: Date: Sun, 4 Mar 2007 18:22:03 +0100 To: "Marcus Boerger" Cc: kingwez@gmail.com, "Arnold Daniels" , internals@lists.php.net In-Reply-To: <592868326.20070304163838@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45E33990.8030806@adaniels.nl> <1331353216.20070226232944@marcus-boerger.de> <45E37D05.5040000@adaniels.nl> <408821909.20070303232323@marcus-boerger.de> <1508893792.20070304144812@marcus-boerger.de> <592868326.20070304163838@marcus-boerger.de> Subject: Re: [PHP-DEV] suggestion SplFileInfo From: pierre.php@gmail.com (Pierre) To make this long story short, I do not understand the reason behind a glob:// stream wrapper. It makes no sense. But yes, we need a better glob support in PHP. Many extensions needs it. For example, I have my own version for zip, it is bad as the only difference is how I get the path string, the pattern implementation being 100% the same (using pcre or bsd's glob) On 3/4/07, Marcus Boerger wrote: > >> > It may be more useful to add streams support to our glob functions. > >> > But it can bring more troubles than expected. > > I did not elaborate on this really. So let me do that now. If we were > going this way we would need to always overwrite the native glob > implementation which we don't do right now. The reason being that we > actually prefer to use the native implementation. Which should also be > faster as a side effect. You miss/drop my point, I don't like the glob:// wrapper addition. It makes no sense as it has no meaning from a URI point of view. To have the pattern matching functions (something like fnmatch for example) always available and exported is indeed a good thing. Many extensions can use it. That does not mean we cannot rely on the system versions when available (for the local file operations at least). > Another thing is that doing so would only make > the glob implementation itself profit from this. Providing the other way > makes anything profit from glob support. Correct me if I'm wrong but a Iterator+filter can do the same thing without having this ugly glob:// $iter = new DirectoryIteratorPattern("/dir1/*.jpeg"); $iter = new DirectoryIteratorPattern("zip://my.zip/dir1/*.jpeg"); $iter = new DirectoryIteratorPattern("ftp://my.zip/dir1/*.jpeg"); Given that the stream wrapper provides the minimum set of ops to do it. > We might even think of adding > support for opening files through glob:// by having it open the first > returned file when used for file opening. I suppose we'll need other functions to move the cursor? Or make it move forward magically on each fopen call? That's ugly. ;-) No other language implements blog or fnmatch support in such way but using iterators and filters (in one form or another). Such magic behaviors are always confusing. > >> Actually the glob stream is exactly nothing else than streams layer > >> for our glob functions. > > > Yes I saw that. That does not make a glob:// a good idea. In my humble > > opinion, it fits better as filter for a iterator (simple loop or > > whatever else like DirectoryIterator). I simply fail to see why the > > stream must have this. > > In the same way as noted above a filter implementation would mean to > have php come with an implementation of glob which we currently do not > always have. We always have it from 5.2.x and up. They are not exported in some earlier versions, I'm not sure which versions have it exported or not. > Damn, it apprears we have different taste :-) It is not about taste. A glob is not a URI-like data. It is a filter. I hope you understand my point now (for better glob support but no glob://), let see what the other developers think about that. --Pierre