On Mon, 12 Sep 2011 18:00:13 +0100, Hannes Magnusson
<hannes.magnus...@gmail.com> wrote:

On Mon, Sep 12, 2011 at 16:56, Gustavo Lopes <glo...@nebm.ist.utl.pt> 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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to