Session Handler based on the HandlerSocket
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
library
README

README

Allows the usage of the php-handlersocket extension ("Percona's noSQL for MySQL") (http://code.google.com/p/php-handlersocket/) as Session Save Handler in the Zend Framework.

The save handler is basically the same as in the example codes.

Example usage:

In your Bootstrap.php

[..]
protected function _initSessionHandler () {
	Zend_Session::setSaveHandler( new favo_Session_SaveHandler_HandlerSocket(
					array(
						'server' => array(
									'host' => 'localhost',
									'port' => 9999,
									'dbname' => 'misc',
									'dbtable' => 'session'
								)
							)
						)
					);
}
[..]


The MySQL Table structure is:

CREATE DATABASE IF NOT EXISTS `misc`;
CREATE TABLE IF NOT EXISTS `misc`.`session` (
  `id` varchar(32) NOT NULL DEFAULT '' COMMENT 'session id',
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'last modification time',
  `data` varchar(6000) DEFAULT NULL COMMENT 'the session data',
  PRIMARY KEY (`id`),
  KEY `modified` (`modified`)
) ENGINE=InnoDB;