PHP Класс Jarves\Cache\Backend\AbstractCache

Наследование: implements Jarves\Cache\Backend\CacheInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$cache array All gets/sets will be cached in this array for faster access during multiple get() calls on the same key.
$instance Contains the current class instance.

Защищенные свойства (Protected)

Свойство Тип Описание
$cacheConfig Jarves\Configuration\Cache
$config array All config values as array.
$eventDispatcher

Открытые методы

Метод Описание
__construct ( ) Constructor.
configure ( Cache $cacheConfig )
delete ( string $key ) : boolean Deletes the cache for specified cache-key.
deleteInvalidate ( string $key ) Removes a invalidation
get ( string $key ) : mixed Returns data of the specified cache-key.
getEventDispatcher ( ) : mixed
getInvalidate ( string $key ) : integer | null Returns latest invalidation timestamp for the given $key.
invalidate ( string $key, boolean | integer $time = null ) : boolean Marks a code as invalidate until $time.
set ( string $key, mixed $value, integer $lifeTime = 3600, boolean $withoutValidationData = false ) : boolean Stores data to the specified cache-key.
setEventDispatcher ( mixed $eventDispatcher )
setup ( $config ) Connects to Server, prepared Folder structure, etc.
testConfig ( array $config ) : boolean Test the cache driver whether the config values are correct and useable or not.

Защищенные методы

Метод Описание
doDelete ( string $pKey ) Deletes data for a key.
doGet ( string $pKey ) : mixed | false Gets the data for a key.
doSet ( string $pKey, mixed $pValue, integer $pTimeout = null ) : boolean Sets data for a key with a timeout.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( )

configure() публичный Метод

public configure ( Cache $cacheConfig )
$cacheConfig Jarves\Configuration\Cache

delete() публичный Метод

Deletes the cache for specified cache-key.
public delete ( string $key ) : boolean
$key string
Результат boolean

deleteInvalidate() публичный Метод

Removes a invalidation
public deleteInvalidate ( string $key )
$key string

doDelete() абстрактный защищенный Метод

Deletes data for a key.
abstract protected doDelete ( string $pKey )
$pKey string

doGet() абстрактный защищенный Метод

Gets the data for a key.
abstract protected doGet ( string $pKey ) : mixed | false
$pKey string
Результат mixed | false return false when cache does not exist

doSet() абстрактный защищенный Метод

Sets data for a key with a timeout.
abstract protected doSet ( string $pKey, mixed $pValue, integer $pTimeout = null ) : boolean
$pKey string
$pValue mixed
$pTimeout integer
Результат boolean

get() публичный Метод

Returns data of the specified cache-key.
public get ( string $key ) : mixed
$key string
Результат mixed

getEventDispatcher() публичный Метод

public getEventDispatcher ( ) : mixed
Результат mixed

getInvalidate() публичный Метод

Returns an timestamp as integer which tells the cache handler that all stored caches before this timestamp are automatically invalidated.
public getInvalidate ( string $key ) : integer | null
$key string
Результат integer | null

invalidate() публичный Метод

Marks a code as invalidate until $time.
public invalidate ( string $key, boolean | integer $time = null ) : boolean
$key string
$time boolean | integer
Результат boolean

set() публичный Метод

If you want to save php class objects, you should serialize it before.
public set ( string $key, mixed $value, integer $lifeTime = 3600, boolean $withoutValidationData = false ) : boolean
$key string
$value mixed Do not pass objects, use serialize if you want to store php objects
$lifeTime integer In seconds. Default is one hour
$withoutValidationData boolean
Результат boolean

setEventDispatcher() публичный Метод

public setEventDispatcher ( mixed $eventDispatcher )
$eventDispatcher mixed

setup() публичный Метод

Connects to Server, prepared Folder structure, etc.
public setup ( $config )

testConfig() публичный Метод

This should also check whether the driver can be used in general or not (like if a necessary php module is loaded or not).
public testConfig ( array $config ) : boolean
$config array
Результат boolean returns true if everything is fine, if not it should throw an exception with the detailed issue.

Описание свойств

$cache публичное свойство

All gets/sets will be cached in this array for faster access during multiple get() calls on the same key.
public array $cache
Результат array

$cacheConfig защищенное свойство

protected Cache,Jarves\Configuration $cacheConfig
Результат Jarves\Configuration\Cache

$config защищенное свойство

All config values as array.
protected array $config
Результат array

$eventDispatcher защищенное свойство

protected $eventDispatcher

$instance публичное свойство

Contains the current class instance.
public $instance