[Solar-talk] Adapter-aware session package

Antti Holvikari anttih at gmail.com
Sat Nov 17 06:44:03 CST 2007


On Nov 11, 2007 7:18 PM, Richard Thomas <lists at cyberlot.net> wrote:
> Hashing can work with either memcache or DB, in the end its all just a
> set of data after its pulled out of the proper layer.

I wrote an SQL session adapter which only writes data when it has been
changed [1].

With it you can for example use Sqlite for storing the session data.
Just set these config keys in your config file:

$config['Solar_Session']['adapter'] = 'Solar_Session_Adapter_Sql';
$config['Solar_Session_Adapter_Sql']['sql']['name'] = '/path/to/db.sq3';

In addition, you need to create the table which will be used. The
adapter accepts config keys for the table name, 'created' column,
'sessid' column and 'data' column.

SQL adapter is useful when you want to query your session data.

Any thoughts? I'd be more than happy to hear how this could be improved.

Ps. I'm sorry for using the Solar vendor-space. Solar doesn't yet
allow me to inject a user-defined session class into it. Which is one
of my goals :-D.

[1] http://lux.googlecode.com/svn/trunk/Solar/Session/Adapter/Sql.php

-- 
Antti Holvikari


More information about the Solar-talk mailing list