PHP Class Pimcore\Cache

Afficher le fichier Open project: pimcore/pimcore Class Usage Examples

Méthodes publiques

Свойство Type Description
$cachePrefix string prefix which will be added to every item-key
$clearedTagsStack array Contains the tags which were already cleared
$defaultLifetime null
$ignoredTagsOnClear array items having one of the tags in this store are not cleared when calling self::clearTags() or self::clearTag()
$instance Zend_Cache_Core | Zend_Cache_Frontend Instance of the used cache-implementation
$logger Logger Contains the Logger, this is necessary because otherwise logging doesn't work in shutdown (missing reference)
$maxWriteToCacheItems integer How many items should stored to the cache within one process
$saveStack array Contains the items which should be written to the cache on shutdown. They are ordered respecting the priority

Protected Properties

Свойство Type Description
$_clearTagsOnShutdown array Items having tags which are in this array are cleared on shutdown \Pimcore::shutdown(); This is especially for the output-cache
$blackHoleCache Zend_Cache_Core
$enabled boolean
$forceImmediateWrite boolean if set to truq items are directly written into the cache, and do not get into the queue
$writeLockTimestamp integer contains the timestamp of the writeLockTime from the current process this is to recheck when removing the write lock (if the value is different -> higher) do not remove the lock because then another process has acquired a lock

Méthodes publiques

Méthode Description
addClearTagOnShutdown ( $tag ) : void Adds a tag to the shutdown queue, see clearTagsOnShutdown
addClearedTag ( string $tag )
addIgnoredTagOnClear ( $tag ) : void
clearAll ( ) : void Empty the cache
clearSaveStack ( )
clearTag ( string $tag ) : void Removes entries from the cache matching the given tag
clearTags ( array $tags = [] ) : void Removes entries from the cache matching the given tags
clearTagsOnShutdown ( ) : void Clears all tags stored in self::$_clearTagsOnShutdown, this function is executed in \Pimcore::shutdown()
disable ( ) : void Disables the complete pimcore cache
enable ( ) : void
getBlackHoleCache ( ) : Zend_Cache_Core | Zend_Cache_Frontend
getDefaultCache ( ) : Zend_Cache_Core | Zend_Cache_Frontend
getDefaultConfig ( string | null $adapter = null ) : array
getForceImmediateWrite ( ) : boolean
getInstance ( ) : Zend_Cache_Core | Zend_Cache_Frontend Returns a instance of the cache, if the instance isn't available it creates a new one
hasWriteLock ( ) : boolean
init ( )
initializeCache ( $config ) : Zend_Cache_Core | Zend_Cache_Frontend
load ( string $key, $doNotTestCacheValidity = false ) : mixed Returns the content of the requested cache entry
maintenance ( )
remove ( $key )
removeIgnoredTagOnClear ( $tag ) : void
removeWriteLock ( )
save ( $data, $key, array $tags = [], null $lifetime = null, integer $priority, boolean $force = false ) : boolean | void
setForceImmediateWrite ( boolean $forceImmediateWrite )
setWriteLock ( $force = false )
setZendFrameworkCaches ( null $cache = null )
test ( string $key ) : integer | boolean Get the last modified time for the requested cache entry
write ( ) : void Write the stack to the cache

Méthodes protégées

Méthode Description
normalizeConfig ( $config ) : mixed
storeToCache ( $data, $key, array $tags = [], null $lifetime = null, boolean $force = false ) : boolean | void Write's an item to the cache // don't use the logger inside here

Method Details

addClearTagOnShutdown() public static méthode

Adds a tag to the shutdown queue, see clearTagsOnShutdown
public static addClearTagOnShutdown ( $tag ) : void
$tag
Résultat void

addClearedTag() public static méthode

public static addClearedTag ( string $tag )
$tag string

addIgnoredTagOnClear() public static méthode

public static addIgnoredTagOnClear ( $tag ) : void
$tag
Résultat void

clearAll() public static méthode

Empty the cache
public static clearAll ( ) : void
Résultat void

clearSaveStack() public méthode

public clearSaveStack ( )

clearTag() public static méthode

Removes entries from the cache matching the given tag
public static clearTag ( string $tag ) : void
$tag string
Résultat void

clearTags() public static méthode

Removes entries from the cache matching the given tags
public static clearTags ( array $tags = [] ) : void
$tags array
Résultat void

clearTagsOnShutdown() public static méthode

Clears all tags stored in self::$_clearTagsOnShutdown, this function is executed in \Pimcore::shutdown()
public static clearTagsOnShutdown ( ) : void
Résultat void

disable() public static méthode

Disables the complete pimcore cache
public static disable ( ) : void
Résultat void

enable() public static méthode

public static enable ( ) : void
Résultat void

getBlackHoleCache() public static méthode

public static getBlackHoleCache ( ) : Zend_Cache_Core | Zend_Cache_Frontend
Résultat Zend_Cache_Core | Zend_Cache_Frontend

getDefaultCache() public static méthode

public static getDefaultCache ( ) : Zend_Cache_Core | Zend_Cache_Frontend
Résultat Zend_Cache_Core | Zend_Cache_Frontend

getDefaultConfig() public static méthode

public static getDefaultConfig ( string | null $adapter = null ) : array
$adapter string | null
Résultat array

getForceImmediateWrite() public static méthode

public static getForceImmediateWrite ( ) : boolean
Résultat boolean

getInstance() public static méthode

Returns a instance of the cache, if the instance isn't available it creates a new one
public static getInstance ( ) : Zend_Cache_Core | Zend_Cache_Frontend
Résultat Zend_Cache_Core | Zend_Cache_Frontend

hasWriteLock() public static méthode

public static hasWriteLock ( ) : boolean
Résultat boolean

init() public static méthode

public static init ( )

initializeCache() public static méthode

public static initializeCache ( $config ) : Zend_Cache_Core | Zend_Cache_Frontend
$config
Résultat Zend_Cache_Core | Zend_Cache_Frontend

load() public static méthode

Returns the content of the requested cache entry
public static load ( string $key, $doNotTestCacheValidity = false ) : mixed
$key string
Résultat mixed

maintenance() public static méthode

public static maintenance ( )

normalizeConfig() protected static méthode

protected static normalizeConfig ( $config ) : mixed
$config
Résultat mixed

remove() public static méthode

public static remove ( $key )
$key

removeIgnoredTagOnClear() public static méthode

public static removeIgnoredTagOnClear ( $tag ) : void
$tag
Résultat void

removeWriteLock() public static méthode

public static removeWriteLock ( )

save() public static méthode

public static save ( $data, $key, array $tags = [], null $lifetime = null, integer $priority, boolean $force = false ) : boolean | void
$data
$key
$tags array
$lifetime null
$priority integer
$force boolean
Résultat boolean | void

setForceImmediateWrite() public static méthode

public static setForceImmediateWrite ( boolean $forceImmediateWrite )
$forceImmediateWrite boolean

setWriteLock() public static méthode

public static setWriteLock ( $force = false )

setZendFrameworkCaches() public static méthode

public static setZendFrameworkCaches ( null $cache = null )
$cache null

storeToCache() protected static méthode

Write's an item to the cache // don't use the logger inside here
protected static storeToCache ( $data, $key, array $tags = [], null $lifetime = null, boolean $force = false ) : boolean | void
$data
$key
$tags array
$lifetime null
$force boolean
Résultat boolean | void

test() public static méthode

Get the last modified time for the requested cache entry
public static test ( string $key ) : integer | boolean
$key string Cache key
Résultat integer | boolean Last modified time of cache entry if it is available, false otherwise

write() public static méthode

Write the stack to the cache
public static write ( ) : void
Résultat void

Property Details

$_clearTagsOnShutdown protected_oe static_oe property

Items having tags which are in this array are cleared on shutdown \Pimcore::shutdown(); This is especially for the output-cache
protected static array $_clearTagsOnShutdown
Résultat array

$blackHoleCache protected_oe static_oe property

protected static Zend_Cache_Core $blackHoleCache
Résultat Zend_Cache_Core

$cachePrefix public_oe static_oe property

prefix which will be added to every item-key
public static string $cachePrefix
Résultat string

$clearedTagsStack public_oe static_oe property

Contains the tags which were already cleared
public static array $clearedTagsStack
Résultat array

$defaultLifetime public_oe static_oe property

public static null $defaultLifetime
Résultat null

$enabled protected_oe static_oe property

protected static bool $enabled
Résultat boolean

$forceImmediateWrite protected_oe static_oe property

if set to truq items are directly written into the cache, and do not get into the queue
protected static bool $forceImmediateWrite
Résultat boolean

$ignoredTagsOnClear public_oe static_oe property

items having one of the tags in this store are not cleared when calling self::clearTags() or self::clearTag()
public static array $ignoredTagsOnClear
Résultat array

$instance public_oe static_oe property

Instance of the used cache-implementation
public static Zend_Cache_Core|Zend_Cache_Frontend $instance
Résultat Zend_Cache_Core | Zend_Cache_Frontend

$logger public_oe static_oe property

Contains the Logger, this is necessary because otherwise logging doesn't work in shutdown (missing reference)
public static Logger,pimcore $logger
Résultat Logger

$maxWriteToCacheItems public_oe static_oe property

How many items should stored to the cache within one process
public static int $maxWriteToCacheItems
Résultat integer

$saveStack public_oe static_oe property

Contains the items which should be written to the cache on shutdown. They are ordered respecting the priority
public static array $saveStack
Résultat array

$writeLockTimestamp protected_oe static_oe property

contains the timestamp of the writeLockTime from the current process this is to recheck when removing the write lock (if the value is different -> higher) do not remove the lock because then another process has acquired a lock
protected static int $writeLockTimestamp
Résultat integer