Upgrade to 3.5.1

This commit is contained in:
Bastian Allgeier
2021-01-19 12:20:38 +01:00
parent 8f55019e01
commit 99c36fa137
119 changed files with 2973 additions and 3707 deletions

View File

@@ -115,7 +115,6 @@ class FileSessionStore extends SessionStore
public function lock(int $expiryTime, string $id)
{
$name = $this->name($expiryTime, $id);
$path = $this->path($name);
// check if the file is already locked
if (isset($this->isLocked[$name])) {
@@ -153,7 +152,6 @@ class FileSessionStore extends SessionStore
public function unlock(int $expiryTime, string $id)
{
$name = $this->name($expiryTime, $id);
$path = $this->path($name);
// check if the file is already unlocked or doesn't exist
if (!isset($this->isLocked[$name])) {
@@ -258,7 +256,6 @@ class FileSessionStore extends SessionStore
public function set(int $expiryTime, string $id, string $data)
{
$name = $this->name($expiryTime, $id);
$path = $this->path($name);
$handle = $this->handle($name);
// validate that we have an exclusive lock already

View File

@@ -335,6 +335,10 @@ class Session
public function commit()
{
// nothing to do if nothing changed or the session has been just created or destroyed
/**
* @todo The $this->destroyed check gets flagged by Psalm for unknown reasons
* @psalm-suppress ParadoxicalCondition
*/
if ($this->writeMode !== true || $this->tokenExpiry === null || $this->destroyed === true) {
return;
}
@@ -515,12 +519,20 @@ class Session
// using $session->ensureToken() -> lazy session creation
// - destroyed sessions are never written to
// - no need to lock and re-init if we are already in write mode
/**
* @todo The $this->destroyed check gets flagged by Psalm for unknown reasons
* @psalm-suppress ParadoxicalCondition
*/
if ($this->tokenExpiry === null || $this->destroyed === true || $this->writeMode === true) {
return;
}
// don't allow writing for read-only sessions
// (only the case for moved sessions)
/**
* @todo This check gets flagged by Psalm for unknown reasons
* @psalm-suppress ParadoxicalCondition
*/
if ($this->tokenKey === null) {
throw new LogicException([
'key' => 'session.readonly',