_config =& $params; if (is_php('7')) { $this->_success = TRUE; $this->_failure = FALSE; } else { $this->_success = 0; $this->_failure = -1; } } // ------------------------------------------------------------------------ /** * PHP 5.x validate ID * * Enforces session.use_strict_mode on PHP 5.x (7+ does it by itself) * * @return void */ public function php5_validate_id() { if (PHP_VERSION_ID < 70000 && isset($_COOKIE[$this->_config['cookie_name']]) && ! $this->validateId($_COOKIE[$this->_config['cookie_name']])) { unset($_COOKIE[$this->_config['cookie_name']]); } } // ------------------------------------------------------------------------ /** * Cookie destroy * * Internal method to force removal of a cookie by the client * when session_destroy() is called. * * @return bool */ protected function _cookie_destroy() { return setcookie( $this->_config['cookie_name'], NULL, 1, $this->_config['cookie_path'], $this->_config['cookie_domain'], $this->_config['cookie_secure'], TRUE ); } // ------------------------------------------------------------------------ /** * Get lock * * A dummy method allowing drivers with no locking functionality * (databases other than PostgreSQL and MySQL) to act as if they * do acquire a lock. * * @param string $session_id * @return bool */ protected function _get_lock($session_id) { $this->_lock = TRUE; return TRUE; } // ------------------------------------------------------------------------ /** * Release lock * * @return bool */ protected function _release_lock() { if ($this->_lock) { $this->_lock = FALSE; } return TRUE; } // ------------------------------------------------------------------------ /** * Fail * * Drivers other than the 'files' one don't (need to) use the * session.save_path INI setting, but that leads to confusing * error messages emitted by PHP when open() or write() fail, * as the message contains session.save_path ... * To work around the problem, the drivers will call this method * so that the INI is set just in time for the error message to * be properly generated. * * @return mixed */ protected function _fail() { ini_set('session.save_path', config_item('sess_save_path')); return $this->_failure; } }