Memcache session handler

php.internals

Glenn Richmond

19 years ago
Hi all, I've just been implementing a memcache session handler that allows for multiple servers in a cluster to store their session data in a central place. I had to make the changes in the PHP source as the user session handler doesn't quite work properly (it wipes the references to the PHP functions when session_write_close is called). Anyway, so it's all working quite well (still undergoing testing) and it works with a main memcache server and a backup as a failover. I'd like to check the code back into the source tree if it's something that might be of use to the general community and am told that this is the list to discuss this? So a couple of queries: * Is this something worth checking back into the main source tree? * How do I get registered as a developer or can I provide it as a .diff to an existing developer? Best Regards, Glenn Richmond.

Antony Dovgal

19 years ago
On 10/20/2006 08:35 AM, Glenn Richmond wrote:
> Hi all, > > I've just been implementing a memcache session handler that allows for > multiple servers in a cluster to store their session data in a central > place. I had to make the changes in the PHP source as the user session > handler doesn't quite work properly (it wipes the references to the PHP > functions when session_write_close is called). Anyway, so it's all > working quite well (still undergoing testing) and it works with a main > memcache server and a backup as a failover. I'd like to check the code > back into the source tree if it's something that might be of use to the > general community and am told that this is the list to discuss this? > > So a couple of queries: > > * Is this something worth checking back into the main source tree? > * How do I get registered as a developer or can I provide it as a > .diff to an existing developer?
I guess you need to contact current PECL/memcache developers.
-- Wbr, Antony Dovgal

Glenn Richmond

19 years ago
Hi Antony, This isn't actually part of the PECL project as I understand it. The PECL memcache project provides a PHP interface to using a memcache server. What I've developed is a memcache session handler that can be used via the php.ini file by: session.handler = memcache As such, it's something that could (or perhaps should) be part of the main source tree. Is there a middle stage here? i.e. Can I provide it as an optional compile flag in the configure script? Glenn. Antony Dovgal wrote:

Antony Dovgal

19 years ago
On 10/20/2006 12:49 PM, Glenn Richmond wrote:
> Hi Antony, > > This isn't actually part of the PECL project as I understand it. The > PECL memcache project provides a PHP interface to using a memcache > server. What I've developed is a memcache session handler that can be > used via the php.ini file by:
Yes, I understand that. I just expected a session handler would use the existing interface to memcache instead of reinventing the wheel. Am I wrong?
> session.handler = memcache > > As such, it's something that could (or perhaps should) be part of the > main source tree. Is there a middle stage here? i.e. Can I provide it as > an optional compile flag in the configure script?
I personally don't think it could/should be a merged into the core, while I'm absolutely fine with merging it to PECL/memcache.
-- Wbr, Antony Dovgal

Glenn Richmond

19 years ago
ok, sure - I just made this assumption because there's an sqlite session handler in there (from what I can see) that I wouldn't have considered standard. I'll discuss with the PECL developers. Glenn. Antony Dovgal wrote:

Andreas Korthaus

19 years ago
Hi Glenn, Glenn Richmond wrote:
> This isn't actually part of the PECL project as I understand it. The > PECL memcache project provides a PHP interface to using a memcache > server. What I've developed is a memcache session handler that can be > used via the php.ini file by: > > session.handler = memcache
That's exactly what you can do with an extension. Perhaps look at eAccelerator for an example: http://eaccelerator.net/browser/eaccelerator/trunk/session.c
> As such, it's something that could (or perhaps should) be part of the > main source tree. Is there a middle stage here? i.e. Can I provide it as > an optional compile flag in the configure script?
I think PECL:memcache is the perfect place for such a session-handler. best regards Andreas

Glenn Richmond

19 years ago
Hi Andreas, Thanks for the suggestion - looks like a nice way to separate it from the main source tree. I'll look at this as an option also :) I think the one nice thing of integrating with the PECL memcache project would be re-using the memcache library backend, but will see how we go. Regards, Glenn. Andreas Korthaus wrote: