From 71a688f97f9b3809b39b5ae8e712be1d369948ef Mon Sep 17 00:00:00 2001 From: Theo Weijmer Date: Wed, 22 Jan 2025 18:52:04 +0100 Subject: [PATCH] codeignter 2.3.13 --- .../Session/CI_Session_driver_interface.php | 60 +++++++++++ .../libraries/Session/OldSessionWrapper.php | 98 +++++++++++++++++ .../libraries/Session/PHP8SessionWrapper.php | 100 ++++++++++++++++++ ...SessionUpdateTimestampHandlerInterface.php | 56 ++++++++++ 4 files changed, 314 insertions(+) create mode 100644 system/libraries/Session/CI_Session_driver_interface.php create mode 100644 system/libraries/Session/OldSessionWrapper.php create mode 100644 system/libraries/Session/PHP8SessionWrapper.php create mode 100644 system/libraries/Session/SessionUpdateTimestampHandlerInterface.php diff --git a/system/libraries/Session/CI_Session_driver_interface.php b/system/libraries/Session/CI_Session_driver_interface.php new file mode 100644 index 0000000..23a0dfd --- /dev/null +++ b/system/libraries/Session/CI_Session_driver_interface.php @@ -0,0 +1,60 @@ +driver = $driver; + } + + public function open($save_path, $name) + { + return $this->driver->open($save_path, $name); + } + + public function close() + { + return $this->driver->close(); + } + + public function read($id) + { + return $this->driver->read($id); + } + + public function write($id, $data) + { + return $this->driver->write($id, $data); + } + + public function destroy($id) + { + return $this->driver->destroy($id); + } + + public function gc($maxlifetime) + { + return $this->driver->gc($maxlifetime); + } + + public function updateTimestamp($id, $data) + { + return $this->driver->updateTimestamp($id, $data); + } + + public function validateId($id) + { + return $this->driver->validateId($id); + } +} diff --git a/system/libraries/Session/PHP8SessionWrapper.php b/system/libraries/Session/PHP8SessionWrapper.php new file mode 100644 index 0000000..41889bc --- /dev/null +++ b/system/libraries/Session/PHP8SessionWrapper.php @@ -0,0 +1,100 @@ +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); + } + + public function updateTimestamp(string $id, string$data): bool + { + return $this->driver->updateTimestamp($id, $data); + } + + public function validateId(string $id): bool + { + return $this->driver->validateId($id); + } +} diff --git a/system/libraries/Session/SessionUpdateTimestampHandlerInterface.php b/system/libraries/Session/SessionUpdateTimestampHandlerInterface.php new file mode 100644 index 0000000..fe4a321 --- /dev/null +++ b/system/libraries/Session/SessionUpdateTimestampHandlerInterface.php @@ -0,0 +1,56 @@ +