Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55392 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64177 invoked from network); 12 Sep 2011 22:45:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2011 22:45:18 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:47634] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/F0-17976-A7B8E6E4 for ; Mon, 12 Sep 2011 18:45:15 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id AD27470003F8 for ; Mon, 12 Sep 2011 23:45:11 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id 7Uuz2ckxmsya for ; Mon, 12 Sep 2011 23:45:11 +0100 (WEST) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 6C76E70003D3 for ; Mon, 12 Sep 2011 23:45:11 +0100 (WEST) Received: from cataphract-old.dulce.lo.geleia.net (cataphract-old.dulce.lo.geleia.net [IPv6:2001:470:94a2:2:9978:6e7:759:40ee]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 69A472008636 for ; Mon, 12 Sep 2011 23:45:10 +0100 (WEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes In-Reply-To: Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_IST?= References: <4E6D0B5C.8030907@php.net> <4E6DF2A9.2040608@php.net> To: "internals@lists.php.net" Date: Mon, 12 Sep 2011 23:45:04 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/11.51 (Win32) Subject: Re: [PHP-DEV] [RFC] Factory for Stream Wrappers From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Mon, 12 Sep 2011 18:00:13 +0100, Hannes Magnusson wrote: > On Mon, Sep 12, 2011 at 16:56, Gustavo Lopes > wrote: >> Ah, right. stat() and unlink() should have been static in the first >> place. >> >> Given the circumstances, it might be a good idea, to document url_stat, >> unlink, rename, mkdir and rmdir to be static and change the >> implementation >> to: >> >> * not instantiate an object if the method is static >> * keep the current behavior if it's not static (but emit E_STRICT) > > That seems like a change in behavior just to change it. It's a change in behavior so it makes sense. Those operations are wrapper operations and by their nature they are static operations, meaning a stream instance is not required. See the difference between php_stream_ops and php_stream_wrapper_ops. It would be a minor change. > Continuing on the off-topic notes.. > I would rather go with an alternative implementation based upon > interfaces (i.e. dirwrapper, filesystemwrapper, streamwrapper...) and > spec it out before adding random magical things that took over 7 years > for people to figure out and document. > And lets not mention the stream_filter_register() and > stream_bucket_new() voodoo. > The stream filtering API is a failed feature, IMO. It has the complexity of APR buckets and brigades without their performance benefits (memory is still copied all the time) -- and of course it's not properly documented. -- Gustavo Lopes