Свойство | Тип | Описание | |
---|---|---|---|
$cacheTime | This is the default time, in seconds, that objects are cached for. | ||
$runtimeDisable | boolean | Disables the cache system wide. It is used internally when the storage engine fails or if the cache is being cleared. This differs from the cacheEnabled property in that it affects all instances of the cache, not just one. |
Свойство | Тип | Описание | |
---|---|---|---|
$cacheEnabled | boolean | Used internally to mark the class as disabled. Unlike the static runtimeDisable flag this is effective only for the current instance. | |
$data | |||
$defaults | array | Contains a list of default arguments for when users do not supply them. | |
$driver | Stash\Interfaces\DriverInterface | The cacheDriver being used by the system. While this class handles all of the higher functions, it's the cache driver here that handles all of the storage/retrieval functionality. This value is set by the constructor. | |
$expiration | |||
$invalidationArg1 | |||
$invalidationArg2 | |||
$invalidationMethod | |||
$key | The identifier for the item being cached. It is set through the setupKey function. | ||
$keyString | string | A serialized version of the key, used primarily used as the index in various arrays. | |
$logger | Psr\Log\LoggerInterface | If set various then errors and exceptions will get passed to the PSR Compliant logging library. This can be set using the setLogger() function in this class. | |
$namespace | string | null | Defines the namespace the item lives in. | |
$pool | Stash\Interfaces\PoolInterface | . | |
$stampedeRunning | boolean | Marks whether or not stampede protection is enabled for this instance of Stash. |
Метод | Описание | |
---|---|---|
__destruct ( ) | This clears out any locks that are present if this Item is prematurely destructed. | |
clear ( ) | ||
disable ( ) | ||
expiresAfter ( $time ) | ||
expiresAt ( $expiration = null ) | ||
extend ( $ttl = null ) | ||
get ( ) | ||
getCreation ( ) | ||
getExpiration ( ) | ||
getKey ( ) | ||
isDisabled ( ) | ||
isHit ( ) | ||
isMiss ( ) | ||
lock ( $ttl = null ) | ||
save ( ) | ||
set ( $value ) | ||
setInvalidationMethod ( $invalidation = Invalidation::PRECOMPUTE, $arg = null, $arg2 = null ) | ||
setKey ( array $key, $namespace = null ) | ||
setLogger ( $logger ) | ||
setPool ( Stash\Interfaces\PoolInterface $pool ) | ||
setTTL ( $ttl = null ) |
Метод | Описание | |
---|---|---|
getRecord ( ) : array | Returns the record for the current key. If there is no record than an empty array is returned. | |
getStampedeFlag ( array $key ) : boolean | Returns true if another Item is currently recalculating the cache. | |
logException ( string $message, Exception $exception ) : boolean | Logs an exception with the Logger class, if it exists. | |
validateRecord ( array $validation, &$record ) | Decides whether the current data is fresh according to the supplied validation technique. As some techniques actively change the record this function takes that in as a reference. |
Метод | Описание | |
---|---|---|
executeClear ( ) | ||
executeGet ( $invalidation = Invalidation::PRECOMPUTE, $arg = null, $arg2 = null ) | ||
executeSet ( $data, $time ) |
public __destruct ( ) |
protected getStampedeFlag ( array $key ) : boolean | ||
$key | array | |
Результат | boolean |
protected logException ( string $message, Exception $exception ) : boolean | ||
$message | string | |
$exception | Exception | |
Результат | boolean |
public setInvalidationMethod ( $invalidation = Invalidation::PRECOMPUTE, $arg = null, $arg2 = null ) |
public setPool ( Stash\Interfaces\PoolInterface $pool ) | ||
$pool | Stash\Interfaces\PoolInterface |
protected validateRecord ( array $validation, &$record ) | ||
$validation | array |
protected bool $cacheEnabled | ||
Результат | boolean |
public static $cacheTime |
protected array $defaults | ||
Результат | array |
protected DriverInterface,Stash\Interfaces $driver | ||
Результат | Stash\Interfaces\DriverInterface |
protected $key |
protected string $keyString | ||
Результат | string |
protected LoggerInterface,Psr\Log $logger | ||
Результат | Psr\Log\LoggerInterface |
protected PoolInterface,Stash\Interfaces $pool | ||
Результат | Stash\Interfaces\PoolInterface |
public static bool $runtimeDisable | ||
Результат | boolean |
protected bool $stampedeRunning | ||
Результат | boolean |