Upgrade to 3.2.0
This commit is contained in:
@@ -7,9 +7,9 @@ namespace Kirby\Session;
|
||||
*
|
||||
* @package Kirby Session
|
||||
* @author Lukas Bestle <lukas@getkirby.com>
|
||||
* @link http://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license MIT
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
class AutoSession
|
||||
{
|
||||
@@ -21,7 +21,7 @@ class AutoSession
|
||||
/**
|
||||
* Creates a new AutoSession instance
|
||||
*
|
||||
* @param SessionStore|string $store SessionStore object or a path to the storage directory (uses the FileSessionStore)
|
||||
* @param Kirby\Session\SessionStore|string $store SessionStore object or a path to the storage directory (uses the FileSessionStore)
|
||||
* @param array $options Optional additional options:
|
||||
* - `durationNormal`: Duration of normal sessions in seconds
|
||||
* Defaults to 2 hours
|
||||
@@ -66,9 +66,9 @@ class AutoSession
|
||||
* Defaults to `cookie`
|
||||
* - `long`: Whether the session is a long "remember me" session or a normal session
|
||||
* Defaults to `false`
|
||||
* @return Session
|
||||
* @return Kirby\Session\Session
|
||||
*/
|
||||
public function get(array $options = []): Session
|
||||
public function get(array $options = [])
|
||||
{
|
||||
// merge options with defaults
|
||||
$options = array_merge([
|
||||
@@ -149,9 +149,9 @@ class AutoSession
|
||||
* Defaults to `1800` (half an hour)
|
||||
* - `renewable`: Should it be possible to extend the expiry date?
|
||||
* Defaults to `true`
|
||||
* @return Session
|
||||
* @return Kirby\Session\Session
|
||||
*/
|
||||
public function createManually(array $options = []): Session
|
||||
public function createManually(array $options = [])
|
||||
{
|
||||
// only ever allow manual transmission mode
|
||||
// to prevent overwriting our "auto" session
|
||||
|
@@ -12,9 +12,9 @@ use Kirby\Toolkit\Str;
|
||||
/**
|
||||
* @package Kirby Session
|
||||
* @author Lukas Bestle <lukas@getkirby.com>
|
||||
* @link http://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license MIT
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
class FileSessionStore extends SessionStore
|
||||
{
|
||||
@@ -370,6 +370,8 @@ class FileSessionStore extends SessionStore
|
||||
|
||||
/**
|
||||
* Cleans up the open locks and file handles
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
|
@@ -15,9 +15,9 @@ use Kirby\Toolkit\Str;
|
||||
/**
|
||||
* @package Kirby Session
|
||||
* @author Lukas Bestle <lukas@getkirby.com>
|
||||
* @link http://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license MIT
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
class Session
|
||||
{
|
||||
@@ -49,7 +49,7 @@ class Session
|
||||
/**
|
||||
* Creates a new Session instance
|
||||
*
|
||||
* @param Sessions $sessions Parent sessions object
|
||||
* @param Kirby\Session\Sessions $sessions Parent sessions object
|
||||
* @param string|null $token Session token or null for a new session
|
||||
* @param array $options Optional additional options:
|
||||
* - `mode`: Token transmission mode (cookie or manual)
|
||||
@@ -305,9 +305,9 @@ class Session
|
||||
/**
|
||||
* Returns the session data object
|
||||
*
|
||||
* @return SessionData
|
||||
* @return Kirby\Session\SessionData
|
||||
*/
|
||||
public function data(): SessionData
|
||||
public function data()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
@@ -12,9 +12,9 @@ use Kirby\Exception\LogicException;
|
||||
*
|
||||
* @package Kirby Session
|
||||
* @author Lukas Bestle <lukas@getkirby.com>
|
||||
* @link http://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license MIT
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
class SessionData
|
||||
{
|
||||
@@ -24,7 +24,8 @@ class SessionData
|
||||
/**
|
||||
* Creates a new SessionData instance
|
||||
*
|
||||
* @param Session $session Session object this data belongs to
|
||||
* @codeCoverageIgnore
|
||||
* @param Kirby\Session\Session $session Session object this data belongs to
|
||||
* @param array $data Currently stored session data
|
||||
*/
|
||||
public function __construct(Session $session, array $data)
|
||||
|
@@ -5,9 +5,9 @@ namespace Kirby\Session;
|
||||
/**
|
||||
* @package Kirby Session
|
||||
* @author Lukas Bestle <lukas@getkirby.com>
|
||||
* @link http://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license MIT
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
abstract class SessionStore
|
||||
{
|
||||
|
@@ -15,9 +15,9 @@ use Kirby\Toolkit\Str;
|
||||
*
|
||||
* @package Kirby Session
|
||||
* @author Lukas Bestle <lukas@getkirby.com>
|
||||
* @link http://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license MIT
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
class Sessions
|
||||
{
|
||||
@@ -30,7 +30,7 @@ class Sessions
|
||||
/**
|
||||
* Creates a new Sessions instance
|
||||
*
|
||||
* @param SessionStore|string $store SessionStore object or a path to the storage directory (uses the FileSessionStore)
|
||||
* @param Kirby\Session\SessionStore|string $store SessionStore object or a path to the storage directory (uses the FileSessionStore)
|
||||
* @param array $options Optional additional options:
|
||||
* - `mode`: Default token transmission mode (cookie, header or manual)
|
||||
* Defaults to `cookie`
|
||||
@@ -105,9 +105,9 @@ class Sessions
|
||||
* Defaults to `1800` (half an hour)
|
||||
* - `renewable`: Should it be possible to extend the expiry date?
|
||||
* Defaults to `true`
|
||||
* @return Session
|
||||
* @return Kirby\Session\Session
|
||||
*/
|
||||
public function create(array $options = []): Session
|
||||
public function create(array $options = [])
|
||||
{
|
||||
// fall back to default mode
|
||||
if (!isset($options['mode'])) {
|
||||
@@ -122,9 +122,9 @@ class Sessions
|
||||
*
|
||||
* @param string $token Session token, either including or without the key
|
||||
* @param string $mode Optional transmission mode override
|
||||
* @return Session
|
||||
* @return Kirby\Session\Session
|
||||
*/
|
||||
public function get(string $token, string $mode = null): Session
|
||||
public function get(string $token, string $mode = null)
|
||||
{
|
||||
if (isset($this->cache[$token])) {
|
||||
return $this->cache[$token];
|
||||
@@ -139,7 +139,7 @@ class Sessions
|
||||
* - In `header` mode: Gets the session from the `Authorization` request header
|
||||
* - In `manual` mode: Fails and throws an Exception
|
||||
*
|
||||
* @return Session|null Either the current session or null in case there isn't one
|
||||
* @return Kirby\Session\Session|null Either the current session or null in case there isn't one
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
@@ -183,7 +183,7 @@ class Sessions
|
||||
* - Tries to get the session from the cookie
|
||||
* - Otherwise returns null
|
||||
*
|
||||
* @return Session|null Either the current session or null in case there isn't one
|
||||
* @return Kirby\Session\Session|null Either the current session or null in case there isn't one
|
||||
*/
|
||||
public function currentDetected()
|
||||
{
|
||||
@@ -211,9 +211,9 @@ class Sessions
|
||||
* Getter for the session store instance
|
||||
* Used internally
|
||||
*
|
||||
* @return SessionStore
|
||||
* @return Kirby\Session\SessionStore
|
||||
*/
|
||||
public function store(): SessionStore
|
||||
public function store()
|
||||
{
|
||||
return $this->store;
|
||||
}
|
||||
|
Reference in New Issue
Block a user