Re: Re: Session: deprecating create_sid() method and add createSid()?

From: Date: Tue, 18 Mar 2014 10:41:43 +0000
Subject: Re: Re: Session: deprecating create_sid() method and add createSid()?
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-73265@lists.php.net to get a copy of this message
Hey, On Tue, Mar 18, 2014 at 9:44 AM, Stas Malyshev <smalyshev@sugarcrm.com> wrote: > Hi! > >> 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. > > Doing to all this length for what? To rename a function? Looks hardly > worth it. > >> 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. > > It doesn't matter - it's there for 10 releases, so it's part of the API. > >> What is your opinion? > > My opinion it would be the best if we could support both and deprecate > create_sid in 5.6, but if it's hard to do cleanly, then leave it alone. I completely agree, and I think we're overthinking the possible solution, so here's what I'm proposing: Add SessionHandler::createId() to 5.5.next, when a userland session handler is in use, it should look for createId() first, create_sid() second and fallback to the internal implementation, whatever it is. parent::create_sid() should call SessionHandler::createId() (this is the dirty hack). Deprecate 'create_sid()' usage in 5.6. Multiple arguments usage of session_set_save_handler() is not affected, it only cares that you pass callables to it. Btw, this usage should probably be deprecated as well, but that's the subject of a separate discussion. Cheers, Andrey.

« previous php.internals (#73265) next »