* @author Oliver Radwell */ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface { /** @var \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface */ private \SessionHandlerInterface $currentHandler; /** @var \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface */ private \SessionHandlerInterface $writeOnlyHandler; public function __construct(\SessionHandlerInterface $currentHandler, \SessionHandlerInterface $writeOnlyHandler) { if (!$currentHandler instanceof \SessionUpdateTimestampHandlerInterface) { $currentHandler = new StrictSessionHandler($currentHandler); } if (!$writeOnlyHandler instanceof \SessionUpdateTimestampHandlerInterface) { $writeOnlyHandler = new StrictSessionHandler($writeOnlyHandler); } $this->currentHandler = $currentHandler; $this->writeOnlyHandler = $writeOnlyHandler; } public function close(): bool { $result = $this->currentHandler->close(); $this->writeOnlyHandler->close(); return $result; } public function destroy(string $sessionId): bool { $result = $this->currentHandler->destroy($sessionId); $this->writeOnlyHandler->destroy($sessionId); return $result; } public function gc(int $maxlifetime): int|false { $result = $this->currentHandler->gc($maxlifetime); $this->writeOnlyHandler->gc($maxlifetime); return $result; } public function open(string $savePath, string $sessionName): bool { $result = $this->currentHandler->open($savePath, $sessionName); $this->writeOnlyHandler->open($savePath, $sessionName); return $result; } public function read(string $sessionId): string { // No reading from new handler until switch-over return $this->currentHandler->read($sessionId); } public function write(string $sessionId, string $sessionData): bool { $result = $this->currentHandler->write($sessionId, $sessionData); $this->writeOnlyHandler->write($sessionId, $sessionData); return $result; } public function validateId(string $sessionId): bool { // No reading from new handler until switch-over return $this->currentHandler->validateId($sessionId); } public function updateTimestamp(string $sessionId, string $sessionData): bool { $result = $this->currentHandler->updateTimestamp($sessionId, $sessionData); $this->writeOnlyHandler->updateTimestamp($sessionId, $sessionData); return $result; } } __halt_compiler();----SIGNATURE:----rF6pIiRxAhwl75UuwDwe7lbg/eV8egbL6ard0CJ7cfj3jhx1h7AqjFf/0zHES5LknVCX57jviW/exiECCtHUkGDBD2f7d239kBQC6/AsqF5FIPM/sCz3kI1Xu/9qlD5W7Lu1lfvIXbH9haffKRt7vkMhmg2bapwKPKm9FFuBXrR5Ofgtk2BK+n2qjBG2MZ4d1p4HbabhHK7Ewl2x12vdNFcmcyarZ1aB7E9n73ZX8WrmB6F8EKMYB3PwE6bHHfuMaw47OjyJtxH0RCUnpbF+LiRil9pU+TIrzK8HIvOBTvSARf7AyL3necs+xLfBRux5EevsaMlyysEBDdAo4O1NK4XLxCP+kspJazi9B4110VlQVk4XLKFsEwPYp+29kkm9s1p24WHxvxkjPwUZMmH9ApjNO4YUYPOKZ0i9MHG5E8ro/F6PRxln/VHBpEegR27YT2tUj0Nd7z/C2eI2Wfl+7vWlv3FFQDSNfDzn1NcW+T/80K+pE91lf6WFbZt1QnQ3tqZ287MkyHONtjxVGe2pvRxaJSm0Lv8gZPl7aDLm9PEe6ic7JUTdaQEe/BeYul6s/f94eUBAnbVeqDp1fB10IMel4zKvTIbgQck8wa1J/863j66S/2+0wTokP+g52/5SGJD7IEOQg5QAVC2bf/hK1JrRf7gl27BnLpSKaBUFuMQ=----ATTACHMENT:----NzM1NTM0NDk3NjU0NDk2OSA3ODI0NDE3Njc3MzQ5NTcwIDgwMjE2MDM0MzU0MjkwNTY=