2017 © Pedro Peláez
 

library memcached-json-session-save-handler

A session save handler for storing sessions in JSON format in memcache. It uses the php-memcached extension.

image

lboynton/memcached-json-session-save-handler

A session save handler for storing sessions in JSON format in memcache. It uses the php-memcached extension.

  • Wednesday, March 20, 2013
  • by lboynton
  • Repository
  • 5 Watchers
  • 13 Stars
  • 656 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 7 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

Memcached JSON Session Save Handler

Build Status, (*1)

A JSON-formatted memcached session save handler. By default, when saving sessions in memcached using the php-memcached extension, serialisation is performed by either php, php_igbinary or WDDX. This custom session save handler serialises the session as JSON and stores it in memcached., (*2)

Installation

Use composer to include the save handler in your application., (*3)

{
    "require": {
        "lboynton/memcached-json-session-save-handler": "0.0.1"
    }
}

Usage

// set up autoloading using composer
require 'vendor/autoload.php';

// create connection to memcached
$memcached = new Memcached();
$memcached->addServer('localhost', 11211);

// register handler (PHP 5.3 compatible)
$handler = new Lboy\Session\SaveHandler\Memcached($memcached);

session_set_save_handler(
    array($handler, 'open'),    
    array($handler, 'close'),
    array($handler, 'read'),
    array($handler, 'write'),
    array($handler, 'destroy'),
    array($handler, 'gc')
);

// the following prevents unexpected effects when using objects as save handlers
register_shutdown_function('session_write_close');

session_start();

// start using the session
$_SESSION['serialisation'] = 'should be in json';

The Versions

20/03 2013

dev-master

9999999-dev https://github.com/lboynton/memcached-json-session-save-handler

A session save handler for storing sessions in JSON format in memcache. It uses the php-memcached extension.

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.0
  • ext-memcached *

 

json memcache memcached session save handler

12/03 2013

0.0.1

0.0.1.0 https://github.com/lboynton/memcached-json-session-save-handler

A session save handler for storing sessions in JSON format in memcache. It uses the php-memcached extension.

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.3.0
  • ext-memcached *

 

json memcache memcached session save handler