CacheEngineApc extends CacheEngine
Table of Contents
Constants
- BX_BASE_LIST = 'BL:'
- BX_INIT_DIR_LIST = 'IL:'
Methods
- __construct() : mixed
- CacheEngine constructor.
- addCleanPath() : void
- addToSet() : mixed
- checkInSet() : bool
- clean() : void
- Cleans (removes) cache directory or file.
- close() : void
- Closes opened connection.
- del() : mixed
- delayedDelete() : void
- deleteBySet() : mixed
- delFromSet() : mixed
- get() : mixed
- getCachePath() : string
- Returns physical file path after read or write operation.
- getConfig() : array<string|int, mixed>
- getConnectionClass() : mixed
- getConnectionName() : string
- getReadBytes() : int
- Returns number of bytes read from cache.
- getSet() : array<string|int, mixed>
- 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 cache has been expired.
- read() : bool
- Reads cache from the memcache. Returns true if key value exists, not expired, and successfully read.
- set() : mixed
- setNotExists() : mixed
- write() : void
- Puts cache into the memcache.
Constants
BX_BASE_LIST
public
mixed
BX_BASE_LIST
= 'BL:'
BX_INIT_DIR_LIST
public
mixed
BX_INIT_DIR_LIST
= 'IL:'
Methods
__construct()
CacheEngine constructor.
public
__construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $options : array<string|int, mixed> = []
-
Cache options.
addCleanPath()
public
addCleanPath() : void
addToSet()
public
addToSet(mixed $key, mixed $value) : mixed
Parameters
- $key : mixed
- $value : mixed
checkInSet()
public
checkInSet(mixed $key, mixed $value) : bool
Parameters
- $key : mixed
- $value : mixed
Return values
boolclean()
Cleans (removes) cache directory or file.
public
clean(string $baseDir[, string $initDir = false ][, string $filename = false ]) : void
Parameters
- $baseDir : string
-
Base cache directory (usually /bitrix/cache).
- $initDir : string = false
-
Directory within base.
- $filename : string = false
-
File name.
close()
Closes opened connection.
public
close() : void
del()
public
del(mixed $key) : mixed
Parameters
- $key : mixed
delayedDelete()
public
delayedDelete() : void
deleteBySet()
public
deleteBySet(mixed $key[, mixed $prefix = '' ]) : mixed
Parameters
- $key : mixed
- $prefix : mixed = ''
delFromSet()
public
delFromSet(mixed $key, mixed $member) : mixed
Parameters
- $key : mixed
- $member : mixed
get()
public
get(mixed $key) : mixed
Parameters
- $key : mixed
getCachePath()
Returns physical file path after read or write operation.
public
getCachePath() : string
Return values
stringgetConfig()
public
getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>getConnectionClass()
public
static getConnectionClass() : mixed
getConnectionName()
public
getConnectionName() : string
Return values
stringgetReadBytes()
Returns number of bytes read from cache.
public
getReadBytes() : int
Return values
intgetSet()
public
getSet(mixed $key) : array<string|int, mixed>
Parameters
- $key : mixed
Return values
array<string|int, mixed>getWrittenBytes()
Returns number of bytes written to cache.
public
getWrittenBytes() : int
Return values
intisAvailable()
Returns true if cache can be read or written.
public
isAvailable() : bool
Return values
boolisCacheExpired()
Returns true if cache has been expired.
public
isCacheExpired(string $path) : bool
Stub function always returns true.
Parameters
- $path : string
-
Absolute physical path.
Return values
boolread()
Reads cache from the memcache. Returns true if key value exists, not expired, and successfully read.
public
read(mixed &$vars, string $baseDir, string $initDir, string $filename, int $ttl) : bool
Parameters
- $vars : mixed
-
Cached result.
- $baseDir : string
-
Base cache directory (usually /bitrix/cache).
- $initDir : string
-
Directory within base.
- $filename : string
-
File name.
- $ttl : int
-
Expiration period in seconds.
Return values
boolset()
public
set(mixed $key, mixed $ttl, mixed $value) : mixed
Parameters
- $key : mixed
- $ttl : mixed
- $value : mixed
setNotExists()
public
setNotExists(mixed $key, mixed $ttl, mixed $value) : mixed
Parameters
- $key : mixed
- $ttl : mixed
- $value : mixed
write()
Puts cache into the memcache.
public
write(mixed $vars, string $baseDir, string $initDir, string $filename, int $ttl) : void
Parameters
- $vars : mixed
-
Cached result.
- $baseDir : string
-
Base cache directory (usually /bitrix/cache).
- $initDir : string
-
Directory within base.
- $filename : string
-
File name.
- $ttl : int
-
Expiration period in seconds.