Re: [RFC] Object oriented session handlers
| From: | Richard Quadling | Date: | Mon, 06 Jun 2011 16:31:00 +0000 |
| Subject: | Re: [RFC] Object oriented session handlers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53042@lists.php.net to get a copy of this message | ||
On 3 June 2011 02:18, Arpad Ray <arraypad@gmail.com> wrote:
> Hi,
>
> A while ago I submitted a patch to allow session_set_save_handler() to
> accept a class, and support the inheritance of the default session
> handler's methods.
>
> The RFC has a more detailed description and the current patch:
> https://wiki.php.net/rfc/session-oo
>
> Changes since this was last discussed:
> - More sanity checking to prevent handlers being called in unexpected states
> - ZTS fixes
>
> Any thoughts?
>
> Regards,
>
> Arpad
Not an internals expert, but I do have a question.
When would the session handler object be destroyed?
If sessions are being logged to a DB (maybe via a userland PHP class),
is internal reference counting enough to handle the order of
destruction?
If the DB connection is destroyed before the session handler gets it
destructor called (or the session_write_close equivalent), the session
won't be able to log the data and there would be no warning to the
client as engine is in auto tidy up mode.
Obviously, if the developer takes care and calls the destructors in
the right order, then everything will be OK, but this is not something
I see very often.
What about circular references and interdependent references?
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea