From 9b7541e04c4976f3cd0366b1866a4c71f3e3bb5f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 5 Jan 2022 12:54:45 +0200 Subject: PHP 8.1 compatibility for sessions (ref #6078) --- system/libraries/Session/PHP8SessionWrapper.php | 90 +++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 system/libraries/Session/PHP8SessionWrapper.php (limited to 'system/libraries/Session/PHP8SessionWrapper.php') diff --git a/system/libraries/Session/PHP8SessionWrapper.php b/system/libraries/Session/PHP8SessionWrapper.php new file mode 100644 index 000000000..c6dfaf7e0 --- /dev/null +++ b/system/libraries/Session/PHP8SessionWrapper.php @@ -0,0 +1,90 @@ +driver = $driver; + } + + public function open(string $save_path, string $name): bool + { + return $this->driver->open($save_path, $name); + } + + public function close(): bool + { + return $this->driver->close(); + } + + #[\ReturnTypeWillChange] + public function read(string $id): mixed + { + return $this->driver->read($id); + } + + public function write(string $id, string $data): bool + { + return $this->driver->write($id, $data); + } + + public function destroy(string $id): bool + { + return $this->driver->destroy($id); + } + + #[\ReturnTypeWillChange] + public function gc(int $maxlifetime): mixed + { + return $this->driver->gc($maxlifetime); + } +} -- cgit v1.2.3-24-g4f1b