ApcuAdapter
extends AbstractAdapter
in package
Tags
Table of Contents
Properties
- $marshaller : MarshallerInterface|null
Methods
- __construct() : mixed
- commit() : bool
- Persists any deferred cache items.
- createConnection() : mixed
- createSystemCache() : AdapterInterface
- Returns the best possible adapter that your runtime supports.
- isSupported() : bool
- doClear() : bool
- doDelete() : bool
- doFetch() : iterable<string|int, mixed>
- doHave() : bool
- doSave() : array<string|int, mixed>|bool
Properties
$marshaller
private
MarshallerInterface|null
$marshaller
Methods
__construct()
public
__construct([string $namespace = '' ][, int $defaultLifetime = 0 ][, string|null $version = null ][, MarshallerInterface|null $marshaller = null ]) : mixed
Parameters
- $namespace : string = ''
- $defaultLifetime : int = 0
- $version : string|null = null
- $marshaller : MarshallerInterface|null = null
Tags
commit()
Persists any deferred cache items.
public
commit() : bool
Return values
bool —True if all not-yet-saved items were successfully saved or there were none. False otherwise.
createConnection()
public
static createConnection(string $dsn[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $dsn : string
- $options : array<string|int, mixed> = []
createSystemCache()
Returns the best possible adapter that your runtime supports.
public
static createSystemCache(string $namespace, int $defaultLifetime, string $version, string $directory[, LoggerInterface|null $logger = null ]) : AdapterInterface
Using ApcuAdapter makes system caches compatible with read-only filesystems.
Parameters
- $namespace : string
- $defaultLifetime : int
- $version : string
- $directory : string
- $logger : LoggerInterface|null = null
Return values
AdapterInterfaceisSupported()
public
static isSupported() : bool
Return values
booldoClear()
protected
doClear(string $namespace) : bool
Parameters
- $namespace : string
Return values
booldoDelete()
protected
doDelete(array<string|int, mixed> $ids) : bool
Parameters
- $ids : array<string|int, mixed>
Return values
booldoFetch()
protected
doFetch(array<string|int, mixed> $ids) : iterable<string|int, mixed>
Parameters
- $ids : array<string|int, mixed>
Return values
iterable<string|int, mixed>doHave()
protected
doHave(string $id) : bool
Parameters
- $id : string
Return values
booldoSave()
protected
doSave(array<string|int, mixed> $values, int $lifetime) : array<string|int, mixed>|bool
Parameters
- $values : array<string|int, mixed>
- $lifetime : int