Skip to content

Commit

Permalink
Fix ComboSession implementation
Browse files Browse the repository at this point in the history
The ComboSession example code is broken: since Cache::gc() returns void, parent::gc() is never called and garbage collection is never executed.
  • Loading branch information
jiru committed Feb 4, 2025
1 parent 8485dee commit 1e4e5d6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion en/development/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ something like::
// Removes expired sessions.
public function gc($expires = null)
{
return Cache::gc($this->cacheKey) && parent::gc($expires);
Cache::gc($this->cacheKey);
return parent::gc($expires);
}
}

Expand Down
3 changes: 2 additions & 1 deletion fr/development/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ devrait ressembler à::
// Retire des sessions expirées.
public function gc($expires = null)
{
return Cache::gc($this->cacheKey) && parent::gc($expires);
Cache::gc($this->cacheKey);
return parent::gc($expires);
}
}

Expand Down
3 changes: 2 additions & 1 deletion ja/development/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ IO をもたらします。
// 有効期限切れセッションの削除
public function gc($expires = null)
{
return Cache::gc($this->cacheKey) && parent::gc($expires);
Cache::gc($this->cacheKey);
return parent::gc($expires);
}
}

Expand Down
3 changes: 2 additions & 1 deletion pt/development/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ A classe deve se parecer com::
// Remove sessões expiradas.
public function gc($expires = null)
{
return Cache::gc($this->cacheKey) && parent::gc($expires);
Cache::gc($this->cacheKey);
return parent::gc($expires);
}
}

Expand Down
3 changes: 2 additions & 1 deletion ru/development/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ CakePHP предоставляет возможность настраивать
// Удаление истёкших сессий.
public function gc($expires = null)
{
return Cache::gc($this->cacheKey) && parent::gc($expires);
Cache::gc($this->cacheKey);
return parent::gc($expires);
}
}

Expand Down

0 comments on commit 1e4e5d6

Please sign in to comment.