mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-19 21:57:48 +01:00
Fix #20140: Fix compatibility with PHP 8.4: calling session_set_save_handler()
This commit is contained in:
committed by
GitHub
parent
5df412df2c
commit
65e3369e16
@@ -171,7 +171,7 @@ class DbSession extends MultiFieldSession
|
||||
* Session read handler.
|
||||
* @internal Do not call this method directly.
|
||||
* @param string $id session ID
|
||||
* @return string the session data
|
||||
* @return string|false the session data, or false on failure
|
||||
*/
|
||||
public function readSession($id)
|
||||
{
|
||||
@@ -247,15 +247,13 @@ class DbSession extends MultiFieldSession
|
||||
* Session GC (garbage collection) handler.
|
||||
* @internal Do not call this method directly.
|
||||
* @param int $maxLifetime the number of seconds after which data will be seen as 'garbage' and cleaned up.
|
||||
* @return bool whether session is GCed successfully
|
||||
* @return int|false the number of deleted sessions on success, or false on failure
|
||||
*/
|
||||
public function gcSession($maxLifetime)
|
||||
{
|
||||
$this->db->createCommand()
|
||||
return $this->db->createCommand()
|
||||
->delete($this->sessionTable, '[[expire]]<:expire', [':expire' => time()])
|
||||
->execute();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user