PHP 클래스 Stash\Item

저자: Robert Hafner ([email protected])
상속: implements Stash\Interfaces\ItemInterface
파일 보기 프로젝트 열기: tedivm/stash 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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 )

메소드 상세

__destruct() 공개 메소드

This clears out any locks that are present if this Item is prematurely destructed.
public __destruct ( )

clear() 공개 메소드

public clear ( )

disable() 공개 메소드

public disable ( )

expiresAfter() 공개 메소드

public expiresAfter ( $time )

expiresAt() 공개 메소드

public expiresAt ( $expiration = null )

extend() 공개 메소드

public extend ( $ttl = null )

get() 공개 메소드

public get ( )

getCreation() 공개 메소드

public getCreation ( )

getExpiration() 공개 메소드

public getExpiration ( )

getKey() 공개 메소드

public getKey ( )

getRecord() 보호된 메소드

Returns the record for the current key. If there is no record than an empty array is returned.
protected getRecord ( ) : array
리턴 array

getStampedeFlag() 보호된 메소드

Returns true if another Item is currently recalculating the cache.
protected getStampedeFlag ( array $key ) : boolean
$key array
리턴 boolean

isDisabled() 공개 메소드

public isDisabled ( )

isHit() 공개 메소드

public isHit ( )

isMiss() 공개 메소드

public isMiss ( )

lock() 공개 메소드

public lock ( $ttl = null )

logException() 보호된 메소드

Logs an exception with the Logger class, if it exists.
protected logException ( string $message, Exception $exception ) : boolean
$message string
$exception Exception
리턴 boolean

save() 공개 메소드

public save ( )

set() 공개 메소드

public set ( $value )

setInvalidationMethod() 공개 메소드

public setInvalidationMethod ( $invalidation = Invalidation::PRECOMPUTE, $arg = null, $arg2 = null )

setKey() 공개 메소드

public setKey ( array $key, $namespace = null )
$key array

setLogger() 공개 메소드

public setLogger ( $logger )

setPool() 공개 메소드

public setPool ( Stash\Interfaces\PoolInterface $pool )
$pool Stash\Interfaces\PoolInterface

setTTL() 공개 메소드

public setTTL ( $ttl = null )

validateRecord() 보호된 메소드

This function has the ability to change the isHit property as well as the record passed.
protected validateRecord ( array $validation, &$record )
$validation array

프로퍼티 상세

$cacheEnabled 보호되어 있는 프로퍼티

Used internally to mark the class as disabled. Unlike the static runtimeDisable flag this is effective only for the current instance.
protected bool $cacheEnabled
리턴 boolean

$cacheTime 공개적으로 정적으로 프로퍼티

This is the default time, in seconds, that objects are cached for.
public static $cacheTime

$data 보호되어 있는 프로퍼티

protected $data

$defaults 보호되어 있는 프로퍼티

Contains a list of default arguments for when users do not supply them.
protected array $defaults
리턴 array

$driver 보호되어 있는 프로퍼티

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.
protected DriverInterface,Stash\Interfaces $driver
리턴 Stash\Interfaces\DriverInterface

$expiration 보호되어 있는 프로퍼티

protected $expiration

$invalidationArg1 보호되어 있는 프로퍼티

protected $invalidationArg1

$invalidationArg2 보호되어 있는 프로퍼티

protected $invalidationArg2

$invalidationMethod 보호되어 있는 프로퍼티

protected $invalidationMethod

$key 보호되어 있는 프로퍼티

The identifier for the item being cached. It is set through the setupKey function.
protected $key

$keyString 보호되어 있는 프로퍼티

A serialized version of the key, used primarily used as the index in various arrays.
protected string $keyString
리턴 string

$logger 보호되어 있는 프로퍼티

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.
protected LoggerInterface,Psr\Log $logger
리턴 Psr\Log\LoggerInterface

$namespace 보호되어 있는 프로퍼티

Defines the namespace the item lives in.
protected string|null $namespace
리턴 string | null

$pool 보호되어 있는 프로퍼티

.
protected PoolInterface,Stash\Interfaces $pool
리턴 Stash\Interfaces\PoolInterface

$runtimeDisable 공개적으로 정적으로 프로퍼티

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.
public static bool $runtimeDisable
리턴 boolean

$stampedeRunning 보호되어 있는 프로퍼티

Marks whether or not stampede protection is enabled for this instance of Stash.
protected bool $stampedeRunning
리턴 boolean