Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28219 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79236 invoked by uid 1010); 4 Mar 2007 14:29:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79221 invoked from network); 4 Mar 2007 14:29:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2007 14:29:10 -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:2924] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/50-08661-5B7DAE54 for ; Sun, 04 Mar 2007 09:29:10 -0500 Received: by wr-out-0506.google.com with SMTP id i31so1140275wra for ; Sun, 04 Mar 2007 06:29:06 -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=qpfigWXUUQWkg23dIgGAkUtAcPgMpMSD+hcqIIpv7n/4l0yuirnhT6QuFCMnhsugQOdL4g8Fzv0inDg5lHKQ9p1i9Mscva1mUXvPvxvltd596qGTwG97DMJnfH+Wt/dJpcLKPxvyC9IEead4tu4yajwLHapO0o0K+4VoxfOGURU= 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=mnfFajpsDR6tkMZFQDmsb7xCXd/wmrE3SoDtkKVjOVd+HeeDaWo0o/cELVgE6e+XFNRnig2QRa0c85WwfL1jWY00hVMfQ4VucKoUx6Ar0z8iG7/jnQ7hezKV22sf+RvlhqAgyifrJtX3H+uXkn30c4+eVKzIGrqd6v7MMhQhNuA= Received: by 10.114.177.1 with SMTP id z1mr929325wae.1173018546414; Sun, 04 Mar 2007 06:29:06 -0800 (PST) Received: by 10.114.178.20 with HTTP; Sun, 4 Mar 2007 06:29:06 -0800 (PST) Message-ID: Date: Sun, 4 Mar 2007 15:29:06 +0100 To: "Marcus Boerger" Cc: kingwez@gmail.com, "Arnold Daniels" , internals@lists.php.net In-Reply-To: <1508893792.20070304144812@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> Subject: Re: [PHP-DEV] suggestion SplFileInfo From: pierre.php@gmail.com (Pierre) On 3/4/07, Marcus Boerger wrote: > Sunday, March 4, 2007, 1:46:40 PM, you wrote: > > > On 3/3/07, Marcus Boerger wrote: > >> Hello Arnold, > >> > >> I added glob directory stream support. Now you can do two things: > >> > >> $d1 = new DirectoryIterator("glob://mydir/*"); > >> $d2 = new DirectoryIterator("mydir/*", DirectoryIterator::USE_GLOB); > >> > >> count() stuff will follow. > > > I'm not sure it is a good idea to add glob:// stream support. What > > does it have to do with custom streams? Will we add pcre:// too? > > If someone feels he needs pcre:// and can implement it why not. Heck no :) > > DirectoryIteratorPattern/Glob($pattern) make much more sense to me. > > Feel free to implement it. Until you do so the problem is that > DirectoryIterator uses streams directory support and cannot do > anything else. Thus the onlyway to change the way it works is to > provide other streams. And that is what I did. I chose to go the > easy route which even might help other people. It is maybe easy to add that (or pcre for that matter), does it make sense? It is not really a resource or custom protocol. Glob or pcre patterns (or any other patterns) are specific filters for a given URI/paths, but not resources specific paths like zip: file: or phar:. > > I did not test it but how does it work when used with other protocols? > > like: ftp://some/path/? > > How is that going to work? Glob does not support that. But anyway, why not > simply test it before complaining? Can you please not see any comment on your commits or additions as complains? It is counter productive, annoying and brings nothing but anger. > > It may be more useful to add streams support to our glob functions. > > But it can bring more troubles than expected. > > 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. --Pierre