This commit is contained in:
2024-07-10 22:30:04 +08:00
parent e1c8139787
commit 0d6df95c34
3 changed files with 9 additions and 3 deletions

View File

@@ -9,7 +9,7 @@
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
define('THINK_VERSION', '5.0.26');
define('THINK_VERSION', '5.0.27');
define('THINK_START_TIME', microtime(true));
define('THINK_START_MEM', memory_get_usage());
define('EXT', '.php');

View File

@@ -42,6 +42,7 @@ class Redis extends SessionHandler
* @return bool
* @throws Exception
*/
#[\ReturnTypeWillChange]
public function open($savePath, $sessName)
{
// 检测php环境
@@ -69,6 +70,7 @@ class Redis extends SessionHandler
* 关闭Session
* @access public
*/
#[\ReturnTypeWillChange]
public function close()
{
$this->gc(ini_get('session.gc_maxlifetime'));
@@ -83,6 +85,7 @@ class Redis extends SessionHandler
* @param string $sessID
* @return string
*/
#[\ReturnTypeWillChange]
public function read($sessID)
{
return (string) $this->handler->get($this->config['session_name'] . $sessID);
@@ -92,9 +95,10 @@ class Redis extends SessionHandler
* 写入Session
* @access public
* @param string $sessID
* @param String $sessData
* @param string $sessData
* @return bool
*/
#[\ReturnTypeWillChange]
public function write($sessID, $sessData)
{
if ($this->config['expire'] > 0) {
@@ -110,6 +114,7 @@ class Redis extends SessionHandler
* @param string $sessID
* @return bool
*/
#[\ReturnTypeWillChange]
public function destroy($sessID)
{
return $this->handler->del($this->config['session_name'] . $sessID) > 0;
@@ -121,6 +126,7 @@ class Redis extends SessionHandler
* @param string $sessMaxLifeTime
* @return bool
*/
#[\ReturnTypeWillChange]
public function gc($sessMaxLifeTime)
{
return true;

View File

@@ -68,7 +68,7 @@
break;
}
$result[] = is_int($key) ? $value : "'{$key}' => {$value}";
$result[] = is_int($key) ? $value : sprintf('\'%s\' => %s', htmlentities($key), $value);
}
return implode(', ', $result);