CacheEngineFiles implements CacheEngineInterface, CacheEngineStatInterface
Table of Contents
Interfaces
Methods
- __construct() : mixed
- Engine constructor.
- clean() : void
- Cleans (removes) the value from the cache by the key (directory or file).
- delayedDelete() : void
- Agent function which deletes marked cache directories.
- getCachePath() : string
- Returns the cache key (path) after read or write operation.
- getReadBytes() : int
- Returns number of bytes read from cache.
- getWrittenBytes() : int
- Returns number of bytes written to cache.
- isAvailable() : bool
- Returns true if cache can be read or written.
- isCacheExpired() : bool
- Returns true if the cache file has expired.
- read() : bool
- Reads the value from the cache. Returns true if the value exists, not expired, and successfully read.
- write() : void
- Writes the value into the cache by the key.
Methods
__construct()
Engine constructor.
public
__construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $options : array<string|int, mixed> = []
-
Cache options.
clean()
Cleans (removes) the value from the cache by the key (directory or file).
public
clean(mixed $baseDir[, mixed $initDir = '' ][, mixed $filename = '' ]) : void
Parameters
- $baseDir : mixed
-
Base cache directory (usually /bitrix/cache).
- $initDir : mixed = ''
-
Directory within base.
- $filename : mixed = ''
-
File name.
Tags
delayedDelete()
Agent function which deletes marked cache directories.
public
delayedDelete() : void
getCachePath()
Returns the cache key (path) after read or write operation.
public
getCachePath() : string
Tags
Return values
stringgetReadBytes()
Returns number of bytes read from cache.
public
getReadBytes() : int
Tags
Return values
intgetWrittenBytes()
Returns number of bytes written to cache.
public
getWrittenBytes() : int
Tags
Return values
intisAvailable()
Returns true if cache can be read or written.
public
isAvailable() : bool
Tags
Return values
boolisCacheExpired()
Returns true if the cache file has expired.
public
isCacheExpired(mixed $path) : bool
Parameters
- $path : mixed
-
Absolute physical path.
Tags
Return values
boolread()
Reads the value from the cache. Returns true if the value exists, not expired, and successfully read.
public
read(mixed &$vars, mixed $baseDir, mixed $initDir, mixed $filename, mixed $ttl) : bool
Parameters
- $vars : mixed
-
Cached result.
- $baseDir : mixed
-
Base cache directory (usually /bitrix/cache).
- $initDir : mixed
-
Directory within base.
- $filename : mixed
-
File name.
- $ttl : mixed
-
Expiration period in seconds.
Tags
Return values
boolwrite()
Writes the value into the cache by the key.
public
write(mixed $vars, mixed $baseDir, mixed $initDir, mixed $filename, mixed $ttl) : void
Parameters
- $vars : mixed
-
Cached result.
- $baseDir : mixed
-
Base cache directory (usually /bitrix/cache).
- $initDir : mixed
-
Directory within base.
- $filename : mixed
-
File name.
- $ttl : mixed
-
Expiration period in seconds.