Helper
This class shares static methods between Responder and other composite classes.
Methods of this class can't call Bitrix API at all.
Tags
Table of Contents
Methods
- __callStatic() : mixed
- checkQuota() : bool
- Checks disk quota.
- cleanAll() : mixed
- compileOptions() : mixed
- convertUriToPath() : string
- Converts URI to a cache key (file path) / => /index.html /index.php => /index.html /aa/bb/ => /aa/bb/index.html /aa/bb/index.php => /aa/bb/index.html /?a=b&b=c => /index@a=b&b=c.html
- deleteUserPrivateKey() : mixed
- escapePHPString() : mixed
- getAjaxRandom() : string|false
- Returns bxrand value
- getCacheFileSize() : bool|float
- Returns the number of bytes of file cache. If file .size doesn't exist returns false
- getConfigFilePath() : mixed
- getDomainName() : mixed|string
- getDomains() : array<string|int, mixed>
- Returns valid domains from the composite options
- getEnabledFilePath() : mixed
- getHttpHost() : string
- Returns HTTP hostname
- getOptions() : array<string|int, mixed>
- Returns an array with cache options.
- getRealPrivateKey() : mixed
- getRequestUri() : string
- Returns Request URI
- getSizeFilePath() : mixed
- getSpaPostfix() : mixed
- getSpaPostfixByUri() : mixed
- getUserPrivateKey() : mixed
- gzdecode() : string
- Decodes a gzip compressed string
- isAjaxRequest() : bool
- Returns true if the current request was initiated by Ajax.
- isAppCacheRequest() : mixed
- isBitrixFolder() : bool
- Returns true if the current request URI has bitrix folder
- isCompositeEnabled() : bool
- Return true if composite mode is enabled
- isCompositeRequest() : mixed
- isOn() : bool
- Return true if html cache is on
- isSpaMode() : mixed
- makeDirPath() : mixed
- readStatistic() : array<string|int, mixed>
- Returns array with cache statistics data.
- removeIgnoredParams() : mixed
- removeRandParam() : string|false
- Removes bxrand parameter from the current request and returns its value
- resetOptions() : mixed
- setEnabled() : mixed
- setOptions() : void
- Saves cache options
- setUserPrivateKey() : mixed
- updateCacheFileSize() : mixed
- updateQuota() : mixed
- Updates disk quota and cache statistic
- writeStatistic() : void
- Updates cache usage statistics.
Methods
__callStatic()
public
static __callStatic(mixed $name, mixed $arguments) : mixed
Parameters
- $name : mixed
- $arguments : mixed
checkQuota()
Checks disk quota.
public
static checkQuota([int $requiredFreeSpace = 0 ]) : bool
Returns true if quota is not exceeded.
Parameters
- $requiredFreeSpace : int = 0
Return values
boolcleanAll()
public
static cleanAll() : mixed
use $page = \Bitrix\Main\Composite\Page::getInstance(); $page->deleteAll();
compileOptions()
public
static compileOptions(mixed &$arOptions) : mixed
Parameters
- $arOptions : mixed
convertUriToPath()
Converts URI to a cache key (file path) / => /index.html /index.php => /index.html /aa/bb/ => /aa/bb/index.html /aa/bb/index.php => /aa/bb/index.html /?a=b&b=c => /index@a=b&b=c.html
public
static convertUriToPath(string $uri[, string $host = null ][, string $privateKey = null ]) : string
Parameters
- $uri : string
- $host : string = null
- $privateKey : string = null
Return values
stringdeleteUserPrivateKey()
public
static deleteUserPrivateKey() : mixed
escapePHPString()
public
static escapePHPString(mixed $str) : mixed
Parameters
- $str : mixed
getAjaxRandom()
Returns bxrand value
public
static getAjaxRandom() : string|false
Return values
string|falsegetCacheFileSize()
Returns the number of bytes of file cache. If file .size doesn't exist returns false
public
static getCacheFileSize() : bool|float
Return values
bool|floatgetConfigFilePath()
public
static getConfigFilePath() : mixed
getDomainName()
public
static getDomainName(mixed $url) : mixed|string
Parameters
- $url : mixed
Return values
mixed|stringgetDomains()
Returns valid domains from the composite options
public
static getDomains() : array<string|int, mixed>
Return values
array<string|int, mixed>getEnabledFilePath()
public
static getEnabledFilePath() : mixed
getHttpHost()
Returns HTTP hostname
public
static getHttpHost([string $host = null ]) : string
Parameters
- $host : string = null
Return values
stringgetOptions()
Returns an array with cache options.
public
static getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getRealPrivateKey()
public
static getRealPrivateKey([mixed $privateKey = null ][, mixed $postfix = null ]) : mixed
Parameters
- $privateKey : mixed = null
- $postfix : mixed = null
getRequestUri()
Returns Request URI
public
static getRequestUri() : string
Return values
stringgetSizeFilePath()
public
static getSizeFilePath() : mixed
getSpaPostfix()
public
static getSpaPostfix() : mixed
getSpaPostfixByUri()
public
static getSpaPostfixByUri(mixed $requestUri) : mixed
Parameters
- $requestUri : mixed
getUserPrivateKey()
public
static getUserPrivateKey() : mixed
gzdecode()
Decodes a gzip compressed string
public
static gzdecode(mixed $data) : string
Parameters
- $data : mixed
Return values
stringisAjaxRequest()
Returns true if the current request was initiated by Ajax.
public
static isAjaxRequest() : bool
Return values
boolisAppCacheRequest()
public
static isAppCacheRequest() : mixed
isBitrixFolder()
Returns true if the current request URI has bitrix folder
public
static isBitrixFolder() : bool
Return values
boolisCompositeEnabled()
Return true if composite mode is enabled
public
static isCompositeEnabled() : bool
Return values
boolisCompositeRequest()
public
static isCompositeRequest() : mixed
isOn()
Return true if html cache is on
public
static isOn() : bool
Return values
boolisSpaMode()
public
static isSpaMode() : mixed
makeDirPath()
public
static makeDirPath(mixed $path) : mixed
Parameters
- $path : mixed
readStatistic()
Returns array with cache statistics data.
public
static readStatistic() : array<string|int, mixed>
Returns an empty array in case of disabled html cache.
Return values
array<string|int, mixed>removeIgnoredParams()
public
static removeIgnoredParams(mixed $queryString) : mixed
Parameters
- $queryString : mixed
removeRandParam()
Removes bxrand parameter from the current request and returns its value
public
static removeRandParam() : string|false
Return values
string|falseresetOptions()
public
static resetOptions() : mixed
setEnabled()
public
static setEnabled(mixed $status[, bool $setDefaults = true ]) : mixed
use Engine::install and Engine::uninstall
Parameters
- $status : mixed
- $setDefaults : bool = true
setOptions()
Saves cache options
public
static setOptions([array<string|int, mixed> $arOptions = array() ]) : void
Parameters
- $arOptions : array<string|int, mixed> = array()
setUserPrivateKey()
public
static setUserPrivateKey(mixed $prefix[, mixed $expire = 0 ]) : mixed
Parameters
- $prefix : mixed
- $expire : mixed = 0
updateCacheFileSize()
public
static updateCacheFileSize([mixed $bytes = 0.0 ]) : mixed
Parameters
- $bytes : mixed = 0.0
updateQuota()
Updates disk quota and cache statistic
public
static updateQuota(float $bytes) : mixed
Parameters
- $bytes : float
-
positive or negative value
writeStatistic()
Updates cache usage statistics.
public
static writeStatistic([int|false $hits = 0 ][, int|false $writings = 0 ][, int|false $quota = 0 ][, int|false $posts = 0 ][, float|false $files = 0.0 ]) : void
Each of parameters is added to appropriate existing stats.
Parameters
- $hits : int|false = 0
-
Number of cache hits.
- $writings : int|false = 0
-
Number of cache writing.
- $quota : int|false = 0
-
Quota change in bytes.
- $posts : int|false = 0
-
Number of POST requests.
- $files : float|false = 0.0
-
File size in bytes.