10 defined(
'JPATH_PLATFORM') or die;
29 public function __construct($options = array())
31 if (!self::isSupported())
33 throw new RuntimeException(
'XCache Extension is not available', 404);
36 parent::__construct($options);
48 public function read($id)
50 $sess_id =
'sess_' . $id;
53 if (!xcache_isset($sess_id))
58 return (
string) xcache_get($sess_id);
71 public function write($id, $session_data)
73 $sess_id =
'sess_' . $id;
74 return xcache_set($sess_id, $session_data, ini_get(
"session.gc_maxlifetime"));
86 public function destroy($id)
88 $sess_id =
'sess_' . $id;
90 if (!xcache_isset($sess_id))
95 return xcache_unset($sess_id);
105 static public function isSupported()
107 return (extension_loaded(
'xcache'));