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
Datei anzeigen Open project: php-cache/cache Class Usage Examples

Protected Properties

Property Type Description
$deferred

Public Methods

Method 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 )

Protected Methods

Method 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

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

Method Details

__destruct() public method

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

clear() public method

public clear ( )

clearAllObjectsFromCache() abstract protected method

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

clearOneObjectFromCache() abstract protected method

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

commit() public method

public commit ( )

deleteItem() public method

public deleteItem ( $key )

deleteItems() public method

public deleteItems ( array $keys )
$keys array

fetchObjectFromCache() abstract protected method

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

getItem() public method

public getItem ( $key )

getItems() public method

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

hasItem() public method

public hasItem ( $key )

log() protected method

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 method

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

saveDeferred() public method

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

setLogger() public method

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

storeItemInCache() abstract protected method

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

validateKey() protected method

protected validateKey ( string $key )
$key string

Property Details

$deferred protected_oe property

protected $deferred