addServer($host, $port, $weight); } public static function get(string $key) : mixed { $sid = Session::getID(); $key = "Session::" . $sid . "::" . $key; $t = Session::$cache->get($key); if ($t) { return unserialize($t); } else { return false; } } public static function set(string $key, mixed $value) : void { $sid = Session::getID(); $fkey = "Session::" . $sid . "::" . $key; Session::$cache->set($fkey, serialize($value));//, 60*60*24*30); } public static function unset(string $key) : void { $sid = Session::getID(); $fkey = "Session::" . $sid . "::" . $key; Session::$cache->delete($fkey); } public static function all_data() { $sid = Session::getID(); $fkey = "Session::" . $sid . "::"; $keys = Session::$cache->getAllKeys(); $data = []; foreach ($keys as $k) { if (str_starts_with($k, $fkey)) { $d = Session::get($k); if (!$d) { $d = []; } $out[$k] = $data; } } return $out; } }