Re: streams and options
| From: | Wez Furlong | Date: | Fri, 19 Apr 2002 16:57:56 +0000 |
| Subject: | Re: streams and options | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-83032@lists.php.net to get a copy of this message | ||
On 19/04/02, "l0t3k" <cshmoove@hotmail.com> wrote:
> Wez,
> scream at me if it seems dumb, but in my never-finished extension,
> each plugin accepts an option hash in the init callback which is used
> to set up the object. the framework also stores this hash as an member
> of the object, and there are accessor methods to query the options.
> this keeps it simple for me..
It doesn't sound dumb at all; that is (in effect) what the streams are
already doing :-)
It's made a bit more complicated because we have potentially a very wide
variety of options/settings, and we also have a two or more layer system:
a stream might be wrapped, and/or it may contain other streams; the single
context parameter holds the options hash for all those associated streams
and their wrappers.
I did forget to mention that file_context_set_option($fp, array(...))
should also be supported, to reduce the number of function calls that
need to be made, and simplify the php scripts.
--Wez.