Re: [PATCH] session_set_save_handler(class)
| From: | Arpad Ray | Date: | Wed, 09 Dec 2009 23:36:36 +0000 |
| Subject: | Re: [PATCH] session_set_save_handler(class) | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46395@lists.php.net to get a copy of this message | ||
Hi,
On Wed, Dec 9, 2009 at 11:16 PM, Stanislav Malyshev <stas@zend.com> wrote:
> It now raises an error rather than segfaulting if the user module is
>> selected but no handler has been registered. This should really halt
>> execution which it doesn't at the moment but I'll raise that separately.
>>
>
> I'd say if it's "user" then it should return an error from the set_handler
> function.
>
>
>
Do you mean when session_set_save_handler() is called more than once? That's
quite harmless and I think it would be useful to wrap frameworks' session
handlers.
The error I'm talking about is when the ini setting session.save_handler is
set to user - we get this during module start-up when the ini settings are
registered.
This is an erroneous configuration since we have no way of registering the
user handlers at that time.
> 4. I think it also makes sense to allow passing object instead of
>> class.
>>
>>
>> I've allowed objects to be passed now but I think this should probably
>> be discouraged since it's going to be called in a static context anyway.
>>
>
> I don't see anything inherently wrong with having session object.
>
>
I don't think that there's anything inherently wrong with it, just that it's
slightly inefficient and offers no benefits since $this isn't available.
Regards,
Arpad