MemoryCache
in
Define memory cache method
Tags
Table of Contents
- Delete() : bool|null
- Delete cache file from storage Remove the values from cache file from storage
- DeleteByPattern() : bool
- Delete by key Delete the entries by given search key pattern
- HasConnection() : bool
- Check if is connected Connects to memcache handler and returns connection status.
- Information() : Result
- Get list of information keys Evaluate the search pattern and return the found information keys
- Keys() : array<string|int, mixed>
- Get list of keys Evaluate the search pattern and return the found top level keys
- Read() : mixed
- Read cache file from storage Get the values from cache file from storage, do deserialize when not raw
- Scan() : array<string|int, mixed>
- Search for keys by pattern
- Write() : mixed
- Write cache file to storage Set the values of cache file to storage, do serialize when not raw
Methods
Delete()
Delete cache file from storage Remove the values from cache file from storage
public
Delete(string $cache_file) : bool|null
Parameters
- $cache_file : string
-
Relative file path
Tags
Return values
bool|null —The delete result
DeleteByPattern()
Delete by key Delete the entries by given search key pattern
public
DeleteByPattern(string $pattern) : bool
Parameters
- $pattern : string
-
Search pattern
Return values
bool —Connection possible and key deleted
HasConnection()
Check if is connected Connects to memcache handler and returns connection status.
public
HasConnection() : bool
Return values
bool —Connection possible
Information()
Get list of information keys Evaluate the search pattern and return the found information keys
public
Information(string|null $pattern) : Result
Parameters
- $pattern : string|null
-
Search pattern
Return values
Result —A list of found keys
Keys()
Get list of keys Evaluate the search pattern and return the found top level keys
public
Keys(string $pattern) : array<string|int, mixed>
Parameters
- $pattern : string
-
Search pattern
Return values
array<string|int, mixed> —A list of found keys
Read()
Read cache file from storage Get the values from cache file from storage, do deserialize when not raw
public
Read(string $cache_file[, bool $raw = false ][, bool $honor_ttl = false ]) : mixed
Parameters
- $cache_file : string
-
Relative file path
- $raw : bool = false
-
When set to true, return the value direct without deserialize.
- $honor_ttl : bool = false
-
Load with ttl automatic
Return values
mixed —The stored values
Scan()
Search for keys by pattern
public
Scan(string $key, string $pattern) : array<string|int, mixed>
Parameters
- $key : string
-
Key to search in
- $pattern : string
-
The pattern to search for
Return values
array<string|int, mixed> —The list of found key value pairs
Write()
Write cache file to storage Set the values of cache file to storage, do serialize when not raw
public
Write(string $cache_file, mixed $data[, bool $raw = false ][, int $ttl = -1 ]) : mixed
Parameters
- $cache_file : string
-
Relative file path
- $data : mixed
-
The data to store
- $raw : bool = false
-
When set to true, return the value direct without deserialize.
- $ttl : int = -1
-
Optional time to live.
Return values
mixed —The stored values