Re: [PATCH] Alias stream_context_get_default() as stream_context_set_default()
| From: | Davey Shafik | Date: | Mon, 04 Aug 2008 17:15:07 +0000 |
| Subject: | Re: [PATCH] Alias stream_context_get_default() as stream_context_set_default() | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39636@lists.php.net to get a copy of this message | ||
I'll see if I can write this as a patch instead; I was trying for
"path of least resistance"
Should be a fun exercise for me! Will get to it tonight.
- Davey
On Mon, Aug 4, 2008 at 7:14 AM, Hannes Magnusson
<hannes.magnusson@gmail.com> wrote:
> On Mon, Aug 4, 2008 at 13:02, Johannes Schlüter <johannes@php.net> wrote:
>> On Mon, 2008-08-04 at 09:49 +0200, Hannes Magnusson wrote:
>>> On Mon, Aug 4, 2008 at 01:29, Davey Shafik <davey@php.net> wrote:
>>> > Hey,
>>> >
>>> > it has come to my attention that stream_context_get_default()
>>> > is /grossly/ misnamed, considering
>> [...]
>>> That doesn't really solve anything as the argument is optional.
>>
>> Adding a new function which enforces the parameter sounds way better
>> then a simple alias.
>
> I agree.
>
>>
>>> In
>>> fact, to me it reads like the default context would be reset to
>>> nothing.
>>
>> I hope not ... I'd expect it to return the current default context
>> unchanged, else that function certainly should be replaced....
>
> Read the example again: $ctx = stream_context_*set*_default(); (using
> the "new alias") :)
>
> using stream_context_*get*_default() without passing context to it
> returns the default context.
>
> -Hannes
>