-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #20140: Fix compatibility with PHP 8.4: calling `session_set_save…
…_handler()`
- Loading branch information
Showing
7 changed files
with
106 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
/** | ||
* @link https://www.yiiframework.com/ | ||
* @copyright Copyright (c) 2008 Yii Software LLC | ||
* @license https://www.yiiframework.com/license/ | ||
*/ | ||
|
||
namespace yii\web; | ||
|
||
use SessionHandlerInterface; | ||
|
||
/** | ||
* SessionHandler implements an [[\SessionHandlerInterface]] for handling [[Session]] with custom session storage. | ||
* | ||
* @author Viktor Khokhryakov <[email protected]> | ||
* @since 2.0.52 | ||
*/ | ||
class SessionHandler implements SessionHandlerInterface | ||
{ | ||
/** | ||
* @var Session | ||
*/ | ||
private $_session; | ||
|
||
public function __construct(Session $session) | ||
{ | ||
$this->_session = $session; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function close(): bool | ||
{ | ||
return $this->_session->closeSession(); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function destroy($id): bool | ||
{ | ||
return $this->_session->destroySession($id); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
#[\ReturnTypeWillChange] | ||
public function gc($max_lifetime) | ||
{ | ||
return $this->_session->gcSession($max_lifetime); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function open($path, $name): bool | ||
{ | ||
return $this->_session->openSession($path, $name); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
#[\ReturnTypeWillChange] | ||
public function read($id) | ||
{ | ||
return $this->_session->readSession($id); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function write($id, $data): bool | ||
{ | ||
return $this->_session->writeSession($id, $data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters