Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55388 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58556 invoked from network); 12 Sep 2011 17:00:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2011 17:00:33 -0000 Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:43951] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/72-17954-0BA3E6E4 for ; Mon, 12 Sep 2011 13:00:33 -0400 Received: by gxk27 with SMTP id 27so6839416gxk.29 for ; Mon, 12 Sep 2011 10:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=XgFGotUQ/Pew9jf6gEx6ULwB8EU+YK2cmEOvsZhm4u4=; b=Lo1t2fUAhFzxlB2OKg9ZBUn3X+Du1yNg0NhossHK/9vtr2pWEvN36BVKICbqJ7W8uK 4feo+upN/bepPICGFvuZAhDyg9yCAwk4WhlhPpv6vdkctfH86HeQU1ZghOQ3Ad+E6iFm vFJrgqPxZMI+vyjBKnMzMsj/zvngu7mpwso04= MIME-Version: 1.0 Received: by 10.236.78.200 with SMTP id g48mr28251725yhe.12.1315846813505; Mon, 12 Sep 2011 10:00:13 -0700 (PDT) Received: by 10.147.98.3 with HTTP; Mon, 12 Sep 2011 10:00:13 -0700 (PDT) In-Reply-To: References: <4E6D0B5C.8030907@php.net> <4E6DF2A9.2040608@php.net> Date: Mon, 12 Sep 2011 19:00:13 +0200 Message-ID: To: Gustavo Lopes Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Factory for Stream Wrappers From: hannes.magnusson@gmail.com (Hannes Magnusson) On Mon, Sep 12, 2011 at 16:56, Gustavo Lopes wrote= : > Em Mon, 12 Sep 2011 15:40:20 +0100, Christian Kaps > escreveu: > >> On Mon, 12 Sep 2011 14:43:33 +0100, Gustavo Lopes wrote: >>> >>> Em Mon, 12 Sep 2011 12:53:13 +0100, Sebastian Bergmann >>> =C2=A0escreveu: >>> >>>> =C2=A0Regarding state it is important to notice that PHP does *not* ex= ecute >>>> =C2=A0the constructor on all low level calls when instantiating the wr= apper >>>> =C2=A0class - for whatever reason that is the case. Changing that beha= viour >>>> =C2=A0would cause quite some side effects, with possible quite some BC >>>> breaks. >>> >>> This is a bit off-topic, but could you elaborate on this (possibly >>> submitting a bug report)? I see user_wrapper_opener trying to call the >>> constructor: >>> >>> http://lxr.php.net/opengrok/xref/PHP_5_3/main/streams/userspace.c#298 >>> >>> So any failure to do this would be a bug. >>> >> >> Not sure if it's actual, but this behaviour is documented: >> http://de3.php.net/manual/en/streamwrapper.construct.php#94731 >> > > 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 implementatio= n > 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. 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. -Hannes