Last active
December 30, 2015 06:59
-
-
Save benlemasurier/7792620 to your computer and use it in GitHub Desktop.
php session wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* $handler = new \Session(); | |
* session_set_save_handler($handler, true); | |
* session_start(); | |
*/ | |
use \SparkLib\Fail; | |
class Session extends SessionHandler { | |
public function __construct() { | |
Fail::log('session->construct()'); | |
} | |
public function read($id) { | |
Fail::log('session->read(' . $id . ')'); | |
return parent::read($id); | |
} | |
public function write($id, $data) { | |
Fail::log('session->write(' . $id . ', ' . $data . ')'); | |
return parent::write($id, $data); | |
} | |
public function close() { | |
Fail::log('session->close()'); | |
return parent::close(); | |
} | |
public function gc($lifetime) { | |
Fail::log('session->gc(' . $lifetime . ')'); | |
return parent::gc($lifetime); | |
} | |
public function open($save_path, $session_id) { | |
Fail::log('session->open(' . $save_path . ', ' . $session_id . ')'); | |
return parent::open($save_path, $session_id); | |
} | |
public function destroy($session_id) { | |
Fail::log('session->destroy(' . $session_id . ')'); | |
return parent_destroy($session_id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment