PHP Class Stash\Pool

Author: Robert Hafner ([email protected])
Inheritance: implements Stash\Interfaces\PoolInterface
Afficher le fichier Open project: tedivm/stash Class Usage Examples

Protected Properties

Свойство Type Description
$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.
$isDisabled boolean Is this Pool disabled.
$itemClass string Default "Item" class to use for making new items.
$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 Current namespace, if any.

Méthodes publiques

Méthode Description
__construct ( Stash\Interfaces\DriverInterface $driver = null ) The constructor takes a Driver class which is used for persistent storage. If no driver is provided then the Ephemeral driver is used by default.
clear ( )
commit ( )
deleteItem ( $key )
deleteItems ( array $keys )
getDriver ( )
getItem ( $key )
getItems ( array $keys = [] )
getNamespace ( )
hasItem ( $key )
purge ( )
save ( Psr\Cache\CacheItemInterface $item )
saveDeferred ( Psr\Cache\CacheItemInterface $item )
setDriver ( Stash\Interfaces\DriverInterface $driver )
setItemClass ( $class )
setLogger ( $logger )
setNamespace ( $namespace = null )

Méthodes protégées

Méthode Description
logException ( string $message, Exception $exception ) : boolean Logs an exception with the Logger class, if it exists.

Method Details

__construct() public méthode

The constructor takes a Driver class which is used for persistent storage. If no driver is provided then the Ephemeral driver is used by default.
public __construct ( Stash\Interfaces\DriverInterface $driver = null )
$driver Stash\Interfaces\DriverInterface

clear() public méthode

public clear ( )

commit() public méthode

public commit ( )

deleteItem() public méthode

public deleteItem ( $key )

deleteItems() public méthode

public deleteItems ( array $keys )
$keys array

getDriver() public méthode

public getDriver ( )

getItem() public méthode

public getItem ( $key )

getItems() public méthode

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

getNamespace() public méthode

public getNamespace ( )

hasItem() public méthode

public hasItem ( $key )

logException() protected méthode

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

purge() public méthode

public purge ( )

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

setDriver() public méthode

public setDriver ( Stash\Interfaces\DriverInterface $driver )
$driver Stash\Interfaces\DriverInterface

setItemClass() public méthode

public setItemClass ( $class )

setLogger() public méthode

public setLogger ( $logger )

setNamespace() public méthode

public setNamespace ( $namespace = null )

Property Details

$driver protected_oe property

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
Résultat Stash\Interfaces\DriverInterface

$isDisabled protected_oe property

Is this Pool disabled.
protected bool $isDisabled
Résultat boolean

$itemClass protected_oe property

Default "Item" class to use for making new items.
protected string $itemClass
Résultat string

$logger protected_oe property

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 Psr\Log\LoggerInterface $logger
Résultat Psr\Log\LoggerInterface

$namespace protected_oe property

Current namespace, if any.
protected string $namespace
Résultat string