PHP Class Cache\Adapter\Common\AbstractCachePool

Author: Aaron Scherer ([email protected])
Author: Tobias Nyholm ([email protected])
Inheritance: implements Psr\Cache\CacheItemPoolInterface, implements Psr\Log\LoggerAwareInterface
Afficher le fichier Open project: php-cache/cache Class Usage Examples

Protected Properties

Свойство Type Description
$deferred

Méthodes publiques

Méthode Description
__destruct ( ) Make sure to commit before we destruct.
clear ( )
commit ( )
deleteItem ( $key )
deleteItems ( array $keys )
getItem ( $key )
getItems ( array $keys = [] )
hasItem ( $key )
save ( Psr\Cache\CacheItemInterface $item )
saveDeferred ( Psr\Cache\CacheItemInterface $item )
setLogger ( Psr\Log\LoggerInterface $logger )

Méthodes protégées

Méthode Description
clearAllObjectsFromCache ( ) : boolean Clear all objects from cache.
clearOneObjectFromCache ( string $key ) : boolean Remove one object from cache.
fetchObjectFromCache ( string $key ) : array Fetch an object from the cache implementation.
log ( mixed $level, string $message, array $context = [] ) Logs with an arbitrary level if the logger exists.
storeItemInCache ( Psr\Cache\CacheItemInterface $item, integer | null $ttl ) : boolean
validateKey ( string $key )

Private Methods

Méthode Description
handleException ( Exception $e, string $function ) Log exception and rethrow it.

Method Details

__destruct() public méthode

Make sure to commit before we destruct.
public __destruct ( )

clear() public méthode

public clear ( )

clearAllObjectsFromCache() abstract protected méthode

Clear all objects from cache.
abstract protected clearAllObjectsFromCache ( ) : boolean
Résultat boolean false if error

clearOneObjectFromCache() abstract protected méthode

Remove one object from cache.
abstract protected clearOneObjectFromCache ( string $key ) : boolean
$key string
Résultat boolean

commit() public méthode

public commit ( )

deleteItem() public méthode

public deleteItem ( $key )

deleteItems() public méthode

public deleteItems ( array $keys )
$keys array

fetchObjectFromCache() abstract protected méthode

Fetch an object from the cache implementation.
abstract protected fetchObjectFromCache ( string $key ) : array
$key string
Résultat array with [isHit, value, [tags]]

getItem() public méthode

public getItem ( $key )

getItems() public méthode

public getItems ( array $keys = [] )
$keys array

hasItem() public méthode

public hasItem ( $key )

log() protected méthode

Logs with an arbitrary level if the logger exists.
protected log ( mixed $level, string $message, array $context = [] )
$level mixed
$message string
$context array

save() public méthode

public save ( Psr\Cache\CacheItemInterface $item )
$item Psr\Cache\CacheItemInterface

saveDeferred() public méthode

public saveDeferred ( Psr\Cache\CacheItemInterface $item )
$item Psr\Cache\CacheItemInterface

setLogger() public méthode

public setLogger ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface

storeItemInCache() abstract protected méthode

abstract protected storeItemInCache ( Psr\Cache\CacheItemInterface $item, integer | null $ttl ) : boolean
$item Psr\Cache\CacheItemInterface
$ttl integer | null seconds from now
Résultat boolean true if saved

validateKey() protected méthode

protected validateKey ( string $key )
$key string

Property Details

$deferred protected_oe property

protected $deferred