2017 © Pedro Peláez
 

library php-sql-session-handler

image

jayc89/php-sql-session-handler

  • Tuesday, January 27, 2015
  • by jayc89
  • Repository
  • 0 Watchers
  • 0 Stars
  • 81 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Deprecated, please use PHP-MySQL-Session-Handler

PHP SQL Session Handler

SQLSessionHandler is a PHP MySQL Session Handler written for use with PHP-MySQL-PDO-Database-Class, (*1)

Installation

composer install jayc89/php-sql-session-handler

Configuration

CREATE TABLE `session_handler` (
    `id` varchar(255) NOT NULL,
    `data` mediumtext NOT NULL,
    `timestamp` int(255) NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
require 'vendor/autoload.php';

$session = new SQLSessionHandler();

// add db data
$session->setDbDetails('localhost', 'username', 'password', 'database');
// OR alternatively send a MySQLi resource
// $db = new Db(); // https://github.com/jayc89/php-mysql-pdo-database-class
// $session->setDbConnection($db);

$session->setDbTable('session_handler');
session_set_save_handler(array($session, 'open'),
                         array($session, 'close'),
                         array($session, 'read'),
                         array($session, 'write'),
                         array($session, 'destroy'),
                         array($session, 'gc'));

register_shutdown_function('session_write_close');
session_start();

License

MIT, (*2)

Free Software, Hell Yeah!, (*3)

Credits

sprainr - https://github.com/sprain/PHP-MySQL-Session-Handler, (*4)

The Versions

27/01 2015

dev-master

9999999-dev

  Sources   Download

The Requires