Re: [PATCH] Alias stream_context_get_default() as stream_context_set_default()

From: Date: Wed, 06 Aug 2008 13:11:52 +0000
Subject: Re: [PATCH] Alias stream_context_get_default() as stream_context_set_default()
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-39697@lists.php.net to get a copy of this message
On Aug 6, 2008, at 03:47 AM, Hannes Magnusson wrote:
On Wed, Aug 6, 2008 at 06:24, Davey Shafik <davey@php.net> wrote:
OK, here's an attempt at a patch[1], I discussed it briefly with Johannes and he felt some discussion was needed with regards to the return value. I personally seem some benefit to returning the "new" context; Johannes wasn't sure that returning "true" might not be a better option in that we cannot return the previous "value" like ini_set().
Why can't we? If there was a default context then return it, otherwise true/false.. Hmh. That could be confusing. I'm fine returning the new context :)
There is always a default context :)
[1] http://pixelated-dreams.com/~davey/stream_context_set_default.patch
The arginfo is wrong, the parameter is required, not optional.
I don't see this, but that's just me not knowing, I thought that anything following a | (pipe) was optional, otherwise it was implicitly required, how do you make an argument explicitly required if that is not the case?
+ parse_context_options(context, params TSRMLS_CC);
The patch has been update to fix the params/options mistake, Still at http://pixelated-dreams.com/~davey/stream_context_set_default.patch - Davey

« previous php.internals (#39697) next »