From 624873ee8c49c572991389932436035ce86f4976 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 24 Jun 2025 10:17:02 +0800 Subject: [PATCH] * [refac bug #63598] revert to not implements SessionHandlerInterface. --- framework/base/router.class.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index b12ff34579..767c721238 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1225,13 +1225,19 @@ class baseRouter { $savePath = $this->getTmpRoot() . 'session'; if(!is_dir($savePath)) mkdir($savePath, 0777, true); - $writable = is_writable($savePath); - if($writable) session_save_path($this->getTmpRoot() . 'session'); - if($writable) + if(is_writable($savePath)) { + session_save_path($this->getTmpRoot() . 'session'); $ztSessionHandler = new ztSessionHandler(); - session_set_save_handler($ztSessionHandler, true); + session_set_save_handler( + $ztSessionHandler->open(...), + $ztSessionHandler->close(...), + $ztSessionHandler->read(...), + $ztSessionHandler->write(...), + $ztSessionHandler->destroy(...), + $ztSessionHandler->gc(...) + ); } } @@ -3791,7 +3797,7 @@ class EndResponseException extends \Exception * * @package framework */ -class ztSessionHandler implements SessionHandlerInterface +class ztSessionHandler { public $sessSavePath; public $sessionFile;