Backend
Less than 1 minute
Backend
- Full name:
\Hazaar\Cache\Backend
- This class implements:
\Hazaar\Cache\Interfaces\Backend
- This class is an Abstract class
Properties
options
public \Hazaar\Map $options
weight
protected int $weight
namespace
protected ?string $namespace
capabilities
The backends list of capabilities.
private string[] $capabilities
Standard capabilities are:
- store_objects - Backend can directly store & return objects. Whether the backend itself really can (like APCu) or the backend class takes care of this.
- compress - Can compress objects being stored. If the backend can do this, then we don't want the frontend to ever do it.
- array - Can return all elements in the cache as an associative array
- expire_ns - Backend supports storage TTLs on the namespace as a whole.
- expire_val - Backend supports storage TTLs on individual values stored within the namespace
- keepalive - When a value is accessed it's TTL can be reset to keep it alive in cache.
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