Re: Re: Session: deprecating create_sid() method and add createSid()?
| From: | Yasuo Ohgaki | Date: | Tue, 18 Mar 2014 00:24:09 +0000 |
| Subject: | Re: Re: Session: deprecating create_sid() method and add createSid()? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-73253@lists.php.net to get a copy of this message | ||
Hi Stas,
On Tue, Mar 18, 2014 at 7:49 AM, Stas Malyshev <smalyshev@sugarcrm.com>wrote:
> > Since create_sid() method is added in 5.5.1 and it's not documented yet.
> > I would like to propose renaming it to createSid() for both 5.5 and 5.6.
>
> Renaming is a BC break and it's there for 10 releases already, so it'd
> be a no go. You can add an alias of createSid, but then you'd have to be
> very careful so that overriding both create_sid and createSid would work
> the same (including when parent:: is involved). If it's hard to do
> cleanly then I'd rather prefer keeping create_sid.
Since session module's object save handler support is legacy, session
module can modify how methods are used/defined when user is not using
interface.
i.e. session module is not using 'interface' normal way.
Procedural session_create_sid() API is there very long time, but
object's create_sid() method was introduced since 5.5.1. I would not
change procedural session_create_sid() name as it is proper name for it.
If user uses undocumented interface (SessionIdInterface) they would have to
implement both createSid() and create_sid(). Alternatively, we may introduce
temporary interface for create_sid(). Or keep it undocumented and rename it
in 5.6 only.
Fortunately, current manual
http://jp2.php.net/manual/en/function.session-set-save-handler.php
is incomplete. It does not mention create_sid() and it's interface. It does
not
use interface for detailed version of example, too.
I'll update the manual when everything is sorted out.
For now, we should decide
- Keep create_sid() method in 5.5 or not
- Add createSid() method in 5.5 or not
- For interface, we have many options. Add new interface for createSid(),
simply adding createSid() to SessionIdInterface, etc.
I think session_sid() should be renamed to sessionSid() for 5.6, but I don't
care much about 5.5. I'll implement it in the way everyone satisfies.
What is your opinion?
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net