示例#1
0
 /**
  * Init session handler.
  */
 public function init()
 {
     if (!$this->database->session_lock_supported()) {
         throw new exception('sessionhandlerproblem', 'error', '', null, 'Database does not support session locking');
     }
     $result = session_set_save_handler(array($this, 'handler_open'), array($this, 'handler_close'), array($this, 'handler_read'), array($this, 'handler_write'), array($this, 'handler_destroy'), array($this, 'handler_gc'));
     if (!$result) {
         throw new exception('dbsessionhandlerproblem', 'error');
     }
 }