Session
About 1 min
Session
- Full name:
\Hazaar\Cache\Backend\Session
- Parent class:
\Hazaar\Cache\Backend
Properties
weight
protected int $weight
timeout
private int $timeout
values
private array $values
started
private static bool $started
- This property is static.
Methods
available
public static available(): bool
- This method is static.
init
public init(string $namespace): void
Parameters:
Parameter | Type | Description |
---|---|---|
$namespace | string | The namespace to use for this session |
close
public close(): bool
has
public has(string $key, bool $check_empty = false): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$check_empty | bool |
get
Return the value with key $key, optionally setting a default in the process.
public get(string $key): mixed
If $default is supplied and no value for $key is currently set in the session then the default value will be set in the session and then returned.
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
set
public set(string $key, mixed $value, int $timeout): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | mixed | |
$timeout | int |
remove
public remove(string $key): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
clear
public clear(): bool
extend
public extend(): void
toArray
public toArray(): array
count
public count(): int
load
private load(string $key): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
Inherited methods
__construct
Backend constructor.
final public __construct(array|\Hazaar\Map $options, string $namespace): mixed
- This method is final.
Parameters:
Parameter | Type | Description |
---|---|---|
$options | array|\Hazaar\Map | |
$namespace | string |
__destruct
public __destruct(): mixed
close
public close(): bool
can
public can(string $key): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
getWeight
public getWeight(): int
setOption
public setOption(string $key, mixed $value): void
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
lock
public lock(string $key): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
unlock
public unlock(string $key): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
addCapabilities
protected addCapabilities(string $args): void
Parameters:
Parameter | Type | Description |
---|---|---|
$args | string |
configure
protected configure(array|\Hazaar\Map $options): void
Parameters:
Parameter | Type | Description |
---|---|---|
$options | array|\Hazaar\Map |
Automatically generated on 2024-11-14