Cache
Less than 1 minute
Cache
- Full name:
\Hazaar\Auth\Storage\Cache
- This class implements:
\Hazaar\Auth\Interfaces\Storage
Properties
session
protected ?\Hazaar\Cache $session
data
private array<string,mixed> $data
config
private \Hazaar\Map $config
sessionID
private ?string $sessionID
blackListedBackends
private static string[] $blackListedBackends
- This property is static.
Methods
__construct
Construct the storage.
public __construct(\Hazaar\Map $config): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$config | \Hazaar\Map | The configuration |
close
public close(): void
isEmpty
Returns true if and only if storage is empty.
public isEmpty(): bool
read
Returns data from storage.
public read(): array<string,mixed>
write
Writes data to storage.
public write(array $data): void
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array |
has
Checks if a key exists in storage.
public has(string $key): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
get
Gets a value from storage.
public get(string $key): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
set
Sets a value in storage.
public set(string $key, mixed $value): void
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
unset
Unsets a value in storage.
public unset(string $key): void
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
clear
Clears data from storage.
public clear(): void
getToken
Returns the storage session token.
public getToken(): array<string,string>
Return Value:
Storage token should be an array with at least a 'token' key and optionally a 'refresh' key
initSession
private initSession(?string $sessionID = null): void
Parameters:
Parameter | Type | Description |
---|---|---|
$sessionID | ?string |
Automatically generated on 2024-11-14