ngsoft/cache

A PSR-6/PSR-16/React/Laravel/Doctrine cache implementation that supports OPCache, APCu, Doctrine, Illuminate or any PSR-6/16 implementations and can chain them all.

2.1.0 2023-12-23 22:19 UTC

This package is auto-updated.

Last update: 2024-04-23 22:56:45 UTC


README

Table of Contents

Method Description
ApcuDriver
ApcuDriver::isSupported
ApcuDriver::__construct
ApcuDriver::clear
ApcuDriver::delete
ApcuDriver::getCacheEntry
ApcuDriver::has
ApcuDriver::__debugInfo
ArrayDriver
ArrayDriver::__construct
ArrayDriver::clear {@inheritdoc}
ArrayDriver::purge Removes expired item entries if supported
ArrayDriver::delete {@inheritdoc}
ArrayDriver::getCacheEntry {@inheritdoc}
ArrayDriver::has {@inheritdoc}
ArrayDriver::__debugInfo
Cache
Cache::invalidateTags Invalidates cached items using tags.
Cache::purge Removes expired item entries if supported
Cache::get Fetches a value from the pool or computes it if not found.
Cache::increment Increment the value of an item in the cache.
Cache::decrement Decrement the value of an item in the cache.
Cache::add Adds data if it doesn't already exists
Cache::clear {@inheritdoc}
Cache::commit {@inheritdoc}
Cache::deleteItem {@inheritdoc}
Cache::deleteItems {@inheritdoc}
Cache::getItem {@inheritdoc}
Cache::getItems {@inheritdoc}
Cache::hasItem {@inheritdoc}
Cache::save {@inheritdoc}
Cache::saveDeferred {@inheritdoc}
Cache::lock {@inheritdoc}
Cache::setPrefix Change cache prefix
Cache::getDriver Access Cache driver directly
Cache::invalidate Increase prefix version, invalidating all prefixed entries
CacheEntry
CacheEntry::__construct
CacheEntry::getCacheItem
CacheEntry::isHit
CacheEntry::create
CacheEntry::createEmpty
CacheEntry::__serialize
CacheEntry::__unserialize
CacheEntry::__toString
CacheError
CacheEvent
CacheEvent::__construct
CacheEvent::getCachePool
CacheHit
CacheHit::__construct
CacheItem A Cache Item
CacheItem::validateKey
CacheItem::create
CacheItem::__construct
CacheItem::tag Adds a tag to a cache item.
CacheItem::getMetadata Returns a list of metadata info that were saved alongside with the cached value.
CacheItem::expiresAfter {@inheritdoc}
CacheItem::expiresAt {@inheritdoc}
CacheItem::get {@inheritdoc}
CacheItem::getKey {@inheritdoc}
CacheItem::isHit {@inheritdoc}
CacheItem::set {@inheritdoc}
CacheItem::__clone {@inheritdoc}
CacheItem::__debugInfo
CacheMiss
CachePool A PSR-6 cache pool
CachePool::__construct
CachePool::__destruct
CachePool::__debugInfo
CachePool::setLogger
CachePool::invalidateTags Invalidates cached items using tags.
CachePool::purge Removes expired item entries if supported
CachePool::get Fetches a value from the pool or computes it if not found.
CachePool::increment Increment the value of an item in the cache.
CachePool::decrement Decrement the value of an item in the cache.
CachePool::add Adds data if it doesn't already exists
CachePool::clear {@inheritdoc}
CachePool::commit {@inheritdoc}
CachePool::deleteItem {@inheritdoc}
CachePool::deleteItems {@inheritdoc}
CachePool::getItem {@inheritdoc}
CachePool::getItems {@inheritdoc}
CachePool::hasItem {@inheritdoc}
CachePool::save {@inheritdoc}
CachePool::saveDeferred {@inheritdoc}
CachePool::lock {@inheritdoc}
ChainDriver
ChainDriver::__construct
ChainDriver::setDefaultLifetime set the default ttl
ChainDriver::count
ChainDriver::getIterator
ChainDriver::getReverseIterator
ChainDriver::set Persists data in the cache
ChainDriver::purge Removes expired item entries if supported
ChainDriver::clear
ChainDriver::delete
ChainDriver::getCacheEntry
ChainDriver::has
ChainDriver::__debugInfo
DoctrineCacheProvider
DoctrineCacheProvider::__construct
DoctrineCacheProvider::getNamespace
DoctrineCacheProvider::setNamespace
DoctrineCacheProvider::setLogger {@inheritdoc}
DoctrineCacheProvider::contains {@inheritdoc}
DoctrineCacheProvider::delete {@inheritdoc}
DoctrineCacheProvider::fetch {@inheritdoc}
DoctrineCacheProvider::save {@inheritdoc}
DoctrineCacheProvider::deleteAll {@inheritdoc}
DoctrineCacheProvider::flushAll {@inheritdoc}
DoctrineCacheProvider::deleteMultiple {@inheritdoc}
DoctrineCacheProvider::fetchMultiple {@inheritdoc}
DoctrineCacheProvider::saveMultiple {@inheritdoc}
DoctrineCacheProvider::getStats
DoctrineDriver
DoctrineDriver::__construct
DoctrineDriver::clear
DoctrineDriver::delete
DoctrineDriver::getCacheEntry
DoctrineDriver::has
DoctrineDriver::__debugInfo
FileCache
FileCache::invalidateTags Invalidates cached items using tags.
FileCache::purge Removes expired item entries if supported
FileCache::get Fetches a value from the pool or computes it if not found.
FileCache::increment Increment the value of an item in the cache.
FileCache::decrement Decrement the value of an item in the cache.
FileCache::add Adds data if it doesn't already exists
FileCache::clear {@inheritdoc}
FileCache::commit {@inheritdoc}
FileCache::deleteItem {@inheritdoc}
FileCache::deleteItems {@inheritdoc}
FileCache::getItem {@inheritdoc}
FileCache::getItems {@inheritdoc}
FileCache::hasItem {@inheritdoc}
FileCache::save {@inheritdoc}
FileCache::saveDeferred {@inheritdoc}
FileCache::lock {@inheritdoc}
FileCache::setPrefix Change cache prefix
FileCache::getDriver Access Cache driver directly
FileCache::invalidate Increase prefix version, invalidating all prefixed entries
FileDriver The oldest cache driver that store binary datas
FileDriver::onWindows
FileDriver::__construct
FileDriver::__destruct
FileDriver::purge Removes expired item entries if supported
FileDriver::clear
FileDriver::delete
FileDriver::getCacheEntry
FileDriver::has
FileDriver::__debugInfo
IlluminateDriver
IlluminateDriver::__construct
IlluminateDriver::clear
IlluminateDriver::delete
IlluminateDriver::getCacheEntry
IlluminateDriver::has
IlluminateDriver::__debugInfo
InvalidArgument
JsonDriver A driver that can be used for Cli applicationsCan store data inside a json config file for example
JsonDriver::__construct
JsonDriver::purge Removes expired item entries if supported
JsonDriver::clear
JsonDriver::delete
JsonDriver::getCacheEntry
JsonDriver::has
JsonDriver::count
JsonDriver::__debugInfo
KeyDeleted
KeySaved
KeySaved::__construct
LaravelStore
LaravelStore::__construct
LaravelStore::setLogger {@inheritdoc}
LaravelStore::increment {@inheritdoc}
LaravelStore::decrement {@inheritdoc}
LaravelStore::flush {@inheritdoc}
LaravelStore::forever {@inheritdoc}
LaravelStore::forget {@inheritdoc}
LaravelStore::get {@inheritdoc}
LaravelStore::getPrefix {@inheritdoc}
LaravelStore::many {@inheritdoc}
LaravelStore::put {@inheritdoc}
LaravelStore::putMany {@inheritdoc}
NullDriver
NullDriver::clear
NullDriver::delete
NullDriver::getCacheEntry
NullDriver::has
PDOAdapter
PDOAdapter::__construct
PDOAdapter::read
PDOAdapter::query
PHPCache A preconfigured cache poolChains ArrayDriver, ApcuDriver, PhpDriver
PHPCache::__construct
PHPCache::appendDriver Put a driver at the end of the chain
PHPCache::prependDriver Put a driver at the beginning of the chain
PhpDriver
PhpDriver::opCacheSupported
PhpDriver::onWindows
PhpDriver::__construct
PhpDriver::__destruct
PhpDriver::purge Removes expired item entries if supported
PhpDriver::clear
PhpDriver::delete
PhpDriver::getCacheEntry
PhpDriver::has
PhpDriver::__debugInfo
PSR16Driver
PSR16Driver::__construct
PSR16Driver::clear
PSR16Driver::delete
PSR16Driver::getCacheEntry
PSR16Driver::has
PSR16Driver::__debugInfo
PSR6Driver
PSR6Driver::__construct
PSR6Driver::getCacheEntry
PSR6Driver::clear
PSR6Driver::delete
PSR6Driver::has
PSR6Driver::__debugInfo
ReactCache
ReactCache::__construct
ReactCache::setLogger {@inheritdoc}
ReactCache::increment Increment the value of an item in the cache.
ReactCache::decrement Decrement the value of an item in the cache.
ReactCache::add Adds data if it doesn't already exists
ReactCache::clear {@inheritdoc}
ReactCache::delete {@inheritdoc}
ReactCache::has {@inheritdoc}
ReactCache::get {@inheritdoc}
ReactCache::set {@inheritdoc}
ReactCache::deleteMultiple {@inheritdoc}
ReactCache::getMultiple {@inheritdoc}
ReactCache::setMultiple {@inheritdoc}
SimpleCachePool PSR-6 to PSR-16 Adapter
SimpleCachePool::__construct
SimpleCachePool::getCachePool {@inheritdoc}
SimpleCachePool::increment Increment the value of an item in the cache.
SimpleCachePool::decrement Decrement the value of an item in the cache.
SimpleCachePool::add Adds data if it doesn't already exists
SimpleCachePool::clear {@inheritdoc}
SimpleCachePool::delete {@inheritdoc}
SimpleCachePool::deleteMultiple {@inheritdoc}
SimpleCachePool::get {@inheritdoc}
SimpleCachePool::getMultiple {@inheritdoc}
SimpleCachePool::has {@inheritdoc}
SimpleCachePool::set {@inheritdoc}
SimpleCachePool::setMultiple {@inheritdoc}
SimpleCachePool::__debugInfo
SQLite3Adapter
SQLite3Adapter::__construct
SQLite3Adapter::read
SQLite3Adapter::query
Sqlite3Driver
Sqlite3Driver::__construct
Sqlite3Driver::purge Removes expired item entries if supported
Sqlite3Driver::clear
Sqlite3Driver::delete
Sqlite3Driver::getCacheEntry
Sqlite3Driver::has
Sqlite3Driver::__debugInfo

ApcuDriver

  • Full name: \NGSOFT\Cache\Drivers\ApcuDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

ApcuDriver::isSupported

ApcuDriver::isSupported(  ): bool
  • This method is static.

Return Value:

ApcuDriver::__construct

ApcuDriver::__construct(  ): mixed

Return Value:

ApcuDriver::clear

ApcuDriver::clear(  ): bool

Return Value:

ApcuDriver::delete

ApcuDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

ApcuDriver::getCacheEntry

ApcuDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

ApcuDriver::has

ApcuDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

ApcuDriver::__debugInfo

ApcuDriver::__debugInfo(  ): array

Return Value:

ArrayDriver

  • Full name: \NGSOFT\Cache\Drivers\ArrayDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

ArrayDriver::__construct

ArrayDriver::__construct( int size = self::DEFAULT_SIZE ): mixed

Parameters:

Parameter Type Description
size int

Return Value:

ArrayDriver::clear

{@inheritdoc}

ArrayDriver::clear(  ): bool

Return Value:

ArrayDriver::purge

Removes expired item entries if supported

ArrayDriver::purge(  ): void

Return Value:

ArrayDriver::delete

{@inheritdoc}

ArrayDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

ArrayDriver::getCacheEntry

{@inheritdoc}

ArrayDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

ArrayDriver::has

{@inheritdoc}

ArrayDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

ArrayDriver::__debugInfo

ArrayDriver::__debugInfo(  ): array

Return Value:

Cache

  • Full name: \NGSOFT\Facades\Cache
  • Parent class:

Cache::invalidateTags

Invalidates cached items using tags.

Cache::invalidateTags( string[]|string tags ): bool

When implemented on a PSR-6 pool, invalidation should not apply to deferred items. Instead, they should be committed as usual. This allows replacing old tagged values by new ones without race conditions.

  • This method is static. Parameters:
Parameter Type Description
tags string[]|string An array of tags to invalidate

Return Value:

True on success

Cache::purge

Removes expired item entries if supported

Cache::purge(  ): void
  • This method is static.

Return Value:

Cache::get

Fetches a value from the pool or computes it if not found.

Cache::get( string key, mixed|\Closure default = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
key string
default mixed|\Closure if set the item will be saved with that value

Return Value:

Cache::increment

Increment the value of an item in the cache.

Cache::increment( string key, int value = 1 ): int
  • This method is static. Parameters:
Parameter Type Description
key string
value int

Return Value:

Cache::decrement

Decrement the value of an item in the cache.

Cache::decrement( string key, int value = 1 ): int
  • This method is static. Parameters:
Parameter Type Description
key string
value int

Return Value:

Cache::add

Adds data if it doesn't already exists

Cache::add( string key, mixed|\Closure value ): bool
  • This method is static. Parameters:
Parameter Type Description
key string
value mixed|\Closure

Return Value:

True if the data have been added, false otherwise

Cache::clear

{@inheritdoc}

Cache::clear(  ): bool
  • This method is static.

Return Value:

Cache::commit

{@inheritdoc}

Cache::commit(  ): bool
  • This method is static.

Return Value:

Cache::deleteItem

{@inheritdoc}

Cache::deleteItem( string key ): bool
  • This method is static. Parameters:
Parameter Type Description
key string

Return Value:

Cache::deleteItems

{@inheritdoc}

Cache::deleteItems( array keys ): bool
  • This method is static. Parameters:
Parameter Type Description
keys array

Return Value:

Cache::getItem

{@inheritdoc}

Cache::getItem( string key ): \NGSOFT\Cache\Interfaces\TaggableCacheItem
  • This method is static. Parameters:
Parameter Type Description
key string

Return Value:

Cache::getItems

{@inheritdoc}

Cache::getItems( array keys = [] ): iterable
  • This method is static. Parameters:
Parameter Type Description
keys array

Return Value:

Cache::hasItem

{@inheritdoc}

Cache::hasItem( string key ): bool
  • This method is static. Parameters:
Parameter Type Description
key string

Return Value:

Cache::save

{@inheritdoc}

Cache::save( \Psr\Cache\CacheItemInterface item ): bool
  • This method is static. Parameters:
Parameter Type Description
item \Psr\Cache\CacheItemInterface

Return Value:

Cache::saveDeferred

{@inheritdoc}

Cache::saveDeferred( \Psr\Cache\CacheItemInterface item ): bool
  • This method is static. Parameters:
Parameter Type Description
item \Psr\Cache\CacheItemInterface

Return Value:

Cache::lock

{@inheritdoc}

Cache::lock( string name, int|float seconds, string owner = '' ): \NGSOFT\Lock\LockStore
  • This method is static. Parameters:
Parameter Type Description
name string
seconds int|float
owner string

Return Value:

Cache::setPrefix

Change cache prefix

Cache::setPrefix( string prefix ): void
  • This method is static. Parameters:
Parameter Type Description
prefix string

Return Value:

Cache::getDriver

Access Cache driver directly

Cache::getDriver(  ): \NGSOFT\Cache\Interfaces\CacheDriver
  • This method is static.

Return Value:

Cache::invalidate

Increase prefix version, invalidating all prefixed entries

Cache::invalidate(  ): bool
  • This method is static.

Return Value:

CacheEntry

  • Full name: \NGSOFT\Cache\CacheEntry
  • This class implements: \Stringable

CacheEntry::__construct

CacheEntry::__construct( string key, int expiry, mixed value = null, array tags = [] ): mixed

Parameters:

Parameter Type Description
key string
expiry int
value mixed
tags array

Return Value:

CacheEntry::getCacheItem

CacheEntry::getCacheItem( string key ): \NGSOFT\Cache\CacheItem

Parameters:

Parameter Type Description
key string

Return Value:

CacheEntry::isHit

CacheEntry::isHit(  ): bool

Return Value:

CacheEntry::create

CacheEntry::create( string key, int expiry, mixed value, array tags ): static
  • This method is static. Parameters:
Parameter Type Description
key string
expiry int
value mixed
tags array

Return Value:

CacheEntry::createEmpty

CacheEntry::createEmpty( string key ): static
  • This method is static. Parameters:
Parameter Type Description
key string

Return Value:

CacheEntry::__serialize

CacheEntry::__serialize(  ): array

Return Value:

CacheEntry::__unserialize

CacheEntry::__unserialize( array data ): void

Parameters:

Parameter Type Description
data array

Return Value:

CacheEntry::__toString

CacheEntry::__toString(  ): string

Return Value:

CacheError

  • Full name: \NGSOFT\Cache\Exceptions\CacheError
  • Parent class:
  • This class implements: \Psr\Cache\CacheException, \Psr\SimpleCache\CacheException

CacheEvent

  • Full name: \NGSOFT\Cache\Events\CacheEvent
  • This class implements: \Psr\EventDispatcher\StoppableEventInterface

CacheEvent::__construct

CacheEvent::__construct( \Psr\Cache\CacheItemPoolInterface cachePool, string key ): mixed

Parameters:

Parameter Type Description
cachePool \Psr\Cache\CacheItemPoolInterface
key string

Return Value:

CacheEvent::getCachePool

CacheEvent::getCachePool(  ): \Psr\Cache\CacheItemPoolInterface

Return Value:

CacheHit

  • Full name: \NGSOFT\Cache\Events\CacheHit
  • Parent class: \NGSOFT\Cache\Events\CacheEvent

CacheHit::__construct

CacheHit::__construct( \Psr\Cache\CacheItemPoolInterface cachePool, string key, mixed value ): mixed

Parameters:

Parameter Type Description
cachePool \Psr\Cache\CacheItemPoolInterface
key string
value mixed

Return Value:

CacheItem

A Cache Item

  • Full name: \NGSOFT\Cache\CacheItem
  • This class implements: \NGSOFT\Cache\Interfaces\TaggableCacheItem, \NGSOFT\Cache, \Stringable

CacheItem::validateKey

CacheItem::validateKey( mixed key ): void
  • This method is static. Parameters:
Parameter Type Description
key mixed

Return Value:

CacheItem::create

CacheItem::create( string key, ?array metadata = null ): static
  • This method is static. Parameters:
Parameter Type Description
key string
metadata ?array

Return Value:

CacheItem::__construct

CacheItem::__construct( string key, ?array metadata = null ): mixed

Parameters:

Parameter Type Description
key string
metadata ?array

Return Value:

CacheItem::tag

Adds a tag to a cache item.

CacheItem::tag( string|iterable tags ): static

Parameters:

Parameter Type Description
tags string|iterable A tag or array of tags

Return Value:

CacheItem::getMetadata

Returns a list of metadata info that were saved alongside with the cached value.

CacheItem::getMetadata(  ): array

Return Value:

CacheItem::expiresAfter

{@inheritdoc}

CacheItem::expiresAfter( int|\DateInterval|null time ): static

Parameters:

Parameter Type Description
time int|\DateInterval|null

Return Value:

CacheItem::expiresAt

{@inheritdoc}

CacheItem::expiresAt( ?\DateTimeInterface expiration ): static

Parameters:

Parameter Type Description
expiration ?\DateTimeInterface

Return Value:

CacheItem::get

{@inheritdoc}

CacheItem::get(  ): mixed

Return Value:

CacheItem::getKey

{@inheritdoc}

CacheItem::getKey(  ): string

Return Value:

CacheItem::isHit

{@inheritdoc}

CacheItem::isHit(  ): bool

Return Value:

CacheItem::set

{@inheritdoc}

CacheItem::set( mixed value ): static

Parameters:

Parameter Type Description
value mixed

Return Value:

CacheItem::__clone

{@inheritdoc}

CacheItem::__clone(  ): void

Return Value:

CacheItem::__debugInfo

CacheItem::__debugInfo(  ): array

Return Value:

CacheMiss

  • Full name: \NGSOFT\Cache\Events\CacheMiss
  • Parent class: \NGSOFT\Cache\Events\CacheEvent

CachePool

A PSR-6 cache pool

  • Full name: \NGSOFT\Cache\CachePool
  • This class implements: \Stringable, \Psr\Log\LoggerAwareInterface, \Psr\Cache\CacheItemPoolInterface, \NGSOFT\Cache, \NGSOFT\Lock\LockProvider

CachePool::__construct

CachePool::__construct( \NGSOFT\Cache\Interfaces\CacheDriver driver, string prefix = '', int defaultLifetime, ?\Psr\Log\LoggerInterface logger = null, ?\Psr\EventDispatcher\EventDispatcherInterface eventDispatcher = null ): mixed

Parameters:

Parameter Type Description
driver \NGSOFT\Cache\Interfaces\CacheDriver
prefix string
defaultLifetime int
logger ?\Psr\Log\LoggerInterface
eventDispatcher ?\Psr\EventDispatcher\EventDispatcherInterface

Return Value:

CachePool::__destruct

CachePool::__destruct(  ): mixed

Return Value:

CachePool::__debugInfo

CachePool::__debugInfo(  ): array

Return Value:

CachePool::setLogger

CachePool::setLogger( \Psr\Log\LoggerInterface logger ): void

Parameters:

Parameter Type Description
logger \Psr\Log\LoggerInterface

Return Value:

CachePool::invalidateTags

Invalidates cached items using tags.

CachePool::invalidateTags( string[]|string tags ): bool

When implemented on a PSR-6 pool, invalidation should not apply to deferred items. Instead, they should be committed as usual. This allows replacing old tagged values by new ones without race conditions.

Parameters:

Parameter Type Description
tags string[]|string An array of tags to invalidate

Return Value:

True on success

CachePool::purge

Removes expired item entries if supported

CachePool::purge(  ): void

Return Value:

CachePool::get

Fetches a value from the pool or computes it if not found.

CachePool::get( string key, mixed|\Closure default = null ): mixed

Parameters:

Parameter Type Description
key string
default mixed|\Closure if set the item will be saved with that value

Return Value:

CachePool::increment

Increment the value of an item in the cache.

CachePool::increment( string key, int value = 1 ): int

Parameters:

Parameter Type Description
key string
value int

Return Value:

CachePool::decrement

Decrement the value of an item in the cache.

CachePool::decrement( string key, int value = 1 ): int

Parameters:

Parameter Type Description
key string
value int

Return Value:

CachePool::add

Adds data if it doesn't already exists

CachePool::add( string key, mixed|\Closure value ): bool

Parameters:

Parameter Type Description
key string
value mixed|\Closure

Return Value:

True if the data have been added, false otherwise

CachePool::clear

{@inheritdoc}

CachePool::clear(  ): bool

Return Value:

CachePool::commit

{@inheritdoc}

CachePool::commit(  ): bool

Return Value:

CachePool::deleteItem

{@inheritdoc}

CachePool::deleteItem( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

CachePool::deleteItems

{@inheritdoc}

CachePool::deleteItems( array keys ): bool

Parameters:

Parameter Type Description
keys array

Return Value:

CachePool::getItem

{@inheritdoc}

CachePool::getItem( string key ): \NGSOFT\Cache\Interfaces\TaggableCacheItem

Parameters:

Parameter Type Description
key string

Return Value:

CachePool::getItems

{@inheritdoc}

CachePool::getItems( array keys = [] ): iterable

Parameters:

Parameter Type Description
keys array

Return Value:

CachePool::hasItem

{@inheritdoc}

CachePool::hasItem( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

CachePool::save

{@inheritdoc}

CachePool::save( \Psr\Cache\CacheItemInterface item ): bool

Parameters:

Parameter Type Description
item \Psr\Cache\CacheItemInterface

Return Value:

CachePool::saveDeferred

{@inheritdoc}

CachePool::saveDeferred( \Psr\Cache\CacheItemInterface item ): bool

Parameters:

Parameter Type Description
item \Psr\Cache\CacheItemInterface

Return Value:

CachePool::lock

{@inheritdoc}

CachePool::lock( string name, int|float seconds, string owner = '' ): \NGSOFT\Lock\LockStore

Parameters:

Parameter Type Description
name string
seconds int|float
owner string

Return Value:

ChainDriver

  • Full name: \NGSOFT\Cache\Drivers\ChainDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver
  • This class implements: \Countable

ChainDriver::__construct

ChainDriver::__construct( iterable drivers ): mixed

Parameters:

Parameter Type Description
drivers iterable

Return Value:

ChainDriver::setDefaultLifetime

set the default ttl

ChainDriver::setDefaultLifetime( int defaultLifetime ): void

Parameters:

Parameter Type Description
defaultLifetime int

Return Value:

ChainDriver::count

ChainDriver::count(  ): int

Return Value:

ChainDriver::getIterator

ChainDriver::getIterator(  ): \Traversable

Return Value:

ChainDriver::getReverseIterator

ChainDriver::getReverseIterator( ?int current = null ): \Traversable

Parameters:

Parameter Type Description
current ?int

Return Value:

ChainDriver::set

Persists data in the cache

ChainDriver::set( string key, mixed value, ?int ttl = null, string|array tags = [] ): bool

Parameters:

Parameter Type Description
key string
value mixed
ttl ?int a value of 0 never expires, a null value uses the default value set in the driver
tags string|array

Return Value:

ChainDriver::purge

Removes expired item entries if supported

ChainDriver::purge(  ): void

Return Value:

ChainDriver::clear

ChainDriver::clear(  ): bool

Return Value:

ChainDriver::delete

ChainDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

ChainDriver::getCacheEntry

ChainDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

ChainDriver::has

ChainDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

ChainDriver::__debugInfo

ChainDriver::__debugInfo(  ): array

Return Value:

DoctrineCacheProvider

  • Full name: \NGSOFT\Cache\Adapters\DoctrineCacheProvider
  • Parent class:
  • This class implements: \NGSOFT\Cache, \Psr\Log\LoggerAwareInterface, \Stringable

DoctrineCacheProvider::__construct

DoctrineCacheProvider::__construct( \NGSOFT\Cache\Interfaces\CacheDriver driver, string prefix = '', int defaultLifetime ): mixed

Parameters:

Parameter Type Description
driver \NGSOFT\Cache\Interfaces\CacheDriver
prefix string
defaultLifetime int

Return Value:

DoctrineCacheProvider::getNamespace

DoctrineCacheProvider::getNamespace(  ): string

Return Value:

DoctrineCacheProvider::setNamespace

DoctrineCacheProvider::setNamespace( mixed namespace ): void

Parameters:

Parameter Type Description
namespace mixed

Return Value:

DoctrineCacheProvider::setLogger

{@inheritdoc}

DoctrineCacheProvider::setLogger( \Psr\Log\LoggerInterface logger ): void

Parameters:

Parameter Type Description
logger \Psr\Log\LoggerInterface

Return Value:

DoctrineCacheProvider::contains

{@inheritdoc}

DoctrineCacheProvider::contains( mixed id ): bool

Parameters:

Parameter Type Description
id mixed

Return Value:

DoctrineCacheProvider::delete

{@inheritdoc}

DoctrineCacheProvider::delete( mixed id ): bool

Parameters:

Parameter Type Description
id mixed

Return Value:

DoctrineCacheProvider::fetch

{@inheritdoc}

DoctrineCacheProvider::fetch( mixed id ): mixed

Parameters:

Parameter Type Description
id mixed

Return Value:

DoctrineCacheProvider::save

{@inheritdoc}

DoctrineCacheProvider::save( mixed id, mixed data, mixed lifeTime ): bool

Parameters:

Parameter Type Description
id mixed
data mixed
lifeTime mixed

Return Value:

DoctrineCacheProvider::deleteAll

{@inheritdoc}

DoctrineCacheProvider::deleteAll(  ): bool

Return Value:

DoctrineCacheProvider::flushAll

{@inheritdoc}

DoctrineCacheProvider::flushAll(  ): bool

Return Value:

DoctrineCacheProvider::deleteMultiple

{@inheritdoc}

DoctrineCacheProvider::deleteMultiple( array keys ): bool

Parameters:

Parameter Type Description
keys array

Return Value:

DoctrineCacheProvider::fetchMultiple

{@inheritdoc}

DoctrineCacheProvider::fetchMultiple( array keys ): array

Parameters:

Parameter Type Description
keys array

Return Value:

DoctrineCacheProvider::saveMultiple

{@inheritdoc}

DoctrineCacheProvider::saveMultiple( array keysAndValues, mixed lifetime ): bool

Parameters:

Parameter Type Description
keysAndValues array
lifetime mixed

Return Value:

DoctrineCacheProvider::getStats

DoctrineCacheProvider::getStats(  ): mixed

Return Value:

DoctrineDriver

  • Full name: \NGSOFT\Cache\Drivers\DoctrineDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

DoctrineDriver::__construct

DoctrineDriver::__construct( \Doctrine\Common\Cache\CacheProvider provider ): mixed

Parameters:

Parameter Type Description
provider \Doctrine\Common\Cache\CacheProvider

Return Value:

DoctrineDriver::clear

DoctrineDriver::clear(  ): bool

Return Value:

DoctrineDriver::delete

DoctrineDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

DoctrineDriver::getCacheEntry

DoctrineDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

DoctrineDriver::has

DoctrineDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

DoctrineDriver::__debugInfo

DoctrineDriver::__debugInfo(  ): array

Return Value:

FileCache

  • Full name: \NGSOFT\Facades\FileCache
  • Parent class:

FileCache::invalidateTags

Invalidates cached items using tags.

FileCache::invalidateTags( string[]|string tags ): bool

When implemented on a PSR-6 pool, invalidation should not apply to deferred items. Instead, they should be committed as usual. This allows replacing old tagged values by new ones without race conditions.

  • This method is static. Parameters:
Parameter Type Description
tags string[]|string An array of tags to invalidate

Return Value:

True on success

FileCache::purge

Removes expired item entries if supported

FileCache::purge(  ): void
  • This method is static.

Return Value:

FileCache::get

Fetches a value from the pool or computes it if not found.

FileCache::get( string key, mixed|\Closure default = null ): mixed
  • This method is static. Parameters:
Parameter Type Description
key string
default mixed|\Closure if set the item will be saved with that value

Return Value:

FileCache::increment

Increment the value of an item in the cache.

FileCache::increment( string key, int value = 1 ): int
  • This method is static. Parameters:
Parameter Type Description
key string
value int

Return Value:

FileCache::decrement

Decrement the value of an item in the cache.

FileCache::decrement( string key, int value = 1 ): int
  • This method is static. Parameters:
Parameter Type Description
key string
value int

Return Value:

FileCache::add

Adds data if it doesn't already exists

FileCache::add( string key, mixed|\Closure value ): bool
  • This method is static. Parameters:
Parameter Type Description
key string
value mixed|\Closure

Return Value:

True if the data have been added, false otherwise

FileCache::clear

{@inheritdoc}

FileCache::clear(  ): bool
  • This method is static.

Return Value:

FileCache::commit

{@inheritdoc}

FileCache::commit(  ): bool
  • This method is static.

Return Value:

FileCache::deleteItem

{@inheritdoc}

FileCache::deleteItem( string key ): bool
  • This method is static. Parameters:
Parameter Type Description
key string

Return Value:

FileCache::deleteItems

{@inheritdoc}

FileCache::deleteItems( array keys ): bool
  • This method is static. Parameters:
Parameter Type Description
keys array

Return Value:

FileCache::getItem

{@inheritdoc}

FileCache::getItem( string key ): \NGSOFT\Cache\Interfaces\TaggableCacheItem
  • This method is static. Parameters:
Parameter Type Description
key string

Return Value:

FileCache::getItems

{@inheritdoc}

FileCache::getItems( array keys = [] ): iterable
  • This method is static. Parameters:
Parameter Type Description
keys array

Return Value:

FileCache::hasItem

{@inheritdoc}

FileCache::hasItem( string key ): bool
  • This method is static. Parameters:
Parameter Type Description
key string

Return Value:

FileCache::save

{@inheritdoc}

FileCache::save( \Psr\Cache\CacheItemInterface item ): bool
  • This method is static. Parameters:
Parameter Type Description
item \Psr\Cache\CacheItemInterface

Return Value:

FileCache::saveDeferred

{@inheritdoc}

FileCache::saveDeferred( \Psr\Cache\CacheItemInterface item ): bool
  • This method is static. Parameters:
Parameter Type Description
item \Psr\Cache\CacheItemInterface

Return Value:

FileCache::lock

{@inheritdoc}

FileCache::lock( string name, int|float seconds, string owner = '' ): \NGSOFT\Lock\LockStore
  • This method is static. Parameters:
Parameter Type Description
name string
seconds int|float
owner string

Return Value:

FileCache::setPrefix

Change cache prefix

FileCache::setPrefix( string prefix ): void
  • This method is static. Parameters:
Parameter Type Description
prefix string

Return Value:

FileCache::getDriver

Access Cache driver directly

FileCache::getDriver(  ): \NGSOFT\Cache\Interfaces\CacheDriver
  • This method is static.

Return Value:

FileCache::invalidate

Increase prefix version, invalidating all prefixed entries

FileCache::invalidate(  ): bool
  • This method is static.

Return Value:

FileDriver

The oldest cache driver that store binary datas

  • Full name: \NGSOFT\Cache\Drivers\FileDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

FileDriver::onWindows

FileDriver::onWindows(  ): bool
  • This method is static.

Return Value:

FileDriver::__construct

FileDriver::__construct( string root = '', string prefix = '' ): mixed

Parameters:

Parameter Type Description
root string
prefix string

Return Value:

FileDriver::__destruct

FileDriver::__destruct(  ): mixed

Return Value:

FileDriver::purge

Removes expired item entries if supported

FileDriver::purge(  ): void

Return Value:

FileDriver::clear

FileDriver::clear(  ): bool

Return Value:

FileDriver::delete

FileDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

FileDriver::getCacheEntry

FileDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

FileDriver::has

FileDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

FileDriver::__debugInfo

FileDriver::__debugInfo(  ): array

Return Value:

IlluminateDriver

  • Full name: \NGSOFT\Cache\Drivers\IlluminateDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

IlluminateDriver::__construct

IlluminateDriver::__construct( \Illuminate\Contracts\Cache\Store provider ): mixed

Parameters:

Parameter Type Description
provider \Illuminate\Contracts\Cache\Store

Return Value:

IlluminateDriver::clear

IlluminateDriver::clear(  ): bool

Return Value:

IlluminateDriver::delete

IlluminateDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

IlluminateDriver::getCacheEntry

IlluminateDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

IlluminateDriver::has

IlluminateDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

IlluminateDriver::__debugInfo

IlluminateDriver::__debugInfo(  ): array

Return Value:

InvalidArgument

  • Full name: \NGSOFT\Cache\Exceptions\InvalidArgument
  • Parent class: \NGSOFT\Cache\Exceptions\CacheError
  • This class implements: \Psr\Cache\InvalidArgumentException, \Psr\SimpleCache\InvalidArgumentException

JsonDriver

A driver that can be used for Cli applications Can store data inside a json config file for example

  • Full name: \NGSOFT\Cache\Drivers\JsonDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver
  • This class implements: \Countable

JsonDriver::__construct

JsonDriver::__construct( string|\NGSOFT\Filesystem\File file = '', string key = 'cache' ): mixed

Parameters:

Parameter Type Description
file string|\NGSOFT\Filesystem\File
key string Key to use inside the object

Return Value:

JsonDriver::purge

Removes expired item entries if supported

JsonDriver::purge(  ): void

Return Value:

JsonDriver::clear

JsonDriver::clear(  ): bool

Return Value:

JsonDriver::delete

JsonDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

JsonDriver::getCacheEntry

JsonDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

JsonDriver::has

JsonDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

JsonDriver::count

JsonDriver::count(  ): int

Return Value:

JsonDriver::__debugInfo

JsonDriver::__debugInfo(  ): array

Return Value:

KeyDeleted

  • Full name: \NGSOFT\Cache\Events\KeyDeleted
  • Parent class: \NGSOFT\Cache\Events\CacheEvent

KeySaved

  • Full name: \NGSOFT\Cache\Events\KeySaved
  • Parent class: \NGSOFT\Cache\Events\CacheEvent

KeySaved::__construct

KeySaved::__construct( \Psr\Cache\CacheItemPoolInterface cachePool, string key, mixed value ): mixed

Parameters:

Parameter Type Description
cachePool \Psr\Cache\CacheItemPoolInterface
key string
value mixed

Return Value:

LaravelStore

  • Full name: \NGSOFT\Cache\Adapters\LaravelStore
  • This class implements: \NGSOFT\Cache, \Illuminate\Contracts\Cache\Store, \Psr\Log\LoggerAwareInterface, \Stringable, \Illuminate\Contracts\Cache\LockProvider

LaravelStore::__construct

LaravelStore::__construct( \NGSOFT\Cache\Interfaces\CacheDriver driver, string prefix = '', int defaultLifetime ): mixed

Parameters:

Parameter Type Description
driver \NGSOFT\Cache\Interfaces\CacheDriver
prefix string
defaultLifetime int

Return Value:

LaravelStore::setLogger

{@inheritdoc}

LaravelStore::setLogger( \Psr\Log\LoggerInterface logger ): void

Parameters:

Parameter Type Description
logger \Psr\Log\LoggerInterface

Return Value:

LaravelStore::increment

{@inheritdoc}

LaravelStore::increment( mixed key, mixed value = 1 ): int

Parameters:

Parameter Type Description
key mixed
value mixed

Return Value:

LaravelStore::decrement

{@inheritdoc}

LaravelStore::decrement( mixed key, mixed value = 1 ): int

Parameters:

Parameter Type Description
key mixed
value mixed

Return Value:

LaravelStore::flush

{@inheritdoc}

LaravelStore::flush(  ): bool

Return Value:

LaravelStore::forever

{@inheritdoc}

LaravelStore::forever( mixed key, mixed value ): bool

Parameters:

Parameter Type Description
key mixed
value mixed

Return Value:

LaravelStore::forget

{@inheritdoc}

LaravelStore::forget( mixed key ): bool

Parameters:

Parameter Type Description
key mixed

Return Value:

LaravelStore::get

{@inheritdoc}

LaravelStore::get( mixed key ): mixed

Parameters:

Parameter Type Description
key mixed

Return Value:

LaravelStore::getPrefix

{@inheritdoc}

LaravelStore::getPrefix(  ): string

Return Value:

LaravelStore::many

{@inheritdoc}

LaravelStore::many( array keys ): array

Parameters:

Parameter Type Description
keys array

Return Value:

LaravelStore::put

{@inheritdoc}

LaravelStore::put( mixed key, mixed value, mixed seconds ): bool

Parameters:

Parameter Type Description
key mixed
value mixed
seconds mixed

Return Value:

LaravelStore::putMany

{@inheritdoc}

LaravelStore::putMany( array values, mixed seconds ): bool

Parameters:

Parameter Type Description
values array
seconds mixed

Return Value:

NullDriver

  • Full name: \NGSOFT\Cache\Drivers\NullDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

NullDriver::clear

NullDriver::clear(  ): bool

Return Value:

NullDriver::delete

NullDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

NullDriver::getCacheEntry

NullDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

NullDriver::has

NullDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

PDOAdapter

  • Full name: \NGSOFT\Cache\Databases\SQLite\PDOAdapter
  • Parent class: \NGSOFT\Cache\Databases\SQLite\QueryEngine

PDOAdapter::__construct

PDOAdapter::__construct( \PDO driver, string table ): mixed

Parameters:

Parameter Type Description
driver \PDO
table string

Return Value:

PDOAdapter::read

PDOAdapter::read( string key, bool data = true ): array|false

Parameters:

Parameter Type Description
key string
data bool

Return Value:

PDOAdapter::query

PDOAdapter::query( string query ): array|bool

Parameters:

Parameter Type Description
query string

Return Value:

PHPCache

A preconfigured cache pool Chains ArrayDriver, ApcuDriver, PhpDriver

  • Full name: \NGSOFT\Cache\PHPCache
  • Parent class: \NGSOFT\Cache\CachePool

PHPCache::__construct

PHPCache::__construct( string rootpath = '', string prefix = '', int defaultLifetime, ?\Psr\Log\LoggerInterface logger = null, ?\Psr\EventDispatcher\EventDispatcherInterface eventDispatcher = null ): mixed

Parameters:

Parameter Type Description
rootpath string
prefix string
defaultLifetime int
logger ?\Psr\Log\LoggerInterface
eventDispatcher ?\Psr\EventDispatcher\EventDispatcherInterface

Return Value:

PHPCache::appendDriver

Put a driver at the end of the chain

PHPCache::appendDriver( \NGSOFT\Cache\Interfaces\CacheDriver driver ): static

Parameters:

Parameter Type Description
driver \NGSOFT\Cache\Interfaces\CacheDriver

Return Value:

PHPCache::prependDriver

Put a driver at the beginning of the chain

PHPCache::prependDriver( \NGSOFT\Cache\Interfaces\CacheDriver driver ): static

Parameters:

Parameter Type Description
driver \NGSOFT\Cache\Interfaces\CacheDriver

Return Value:

PhpDriver

  • Full name: \NGSOFT\Cache\Drivers\PhpDriver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

PhpDriver::opCacheSupported

PhpDriver::opCacheSupported(  ): bool
  • This method is static.

Return Value:

PhpDriver::onWindows

PhpDriver::onWindows(  ): bool
  • This method is static.

Return Value:

PhpDriver::__construct

PhpDriver::__construct( string root = '', string prefix = '' ): mixed

Parameters:

Parameter Type Description
root string
prefix string

Return Value:

PhpDriver::__destruct

PhpDriver::__destruct(  ): mixed

Return Value:

PhpDriver::purge

Removes expired item entries if supported

PhpDriver::purge(  ): void

Return Value:

PhpDriver::clear

PhpDriver::clear(  ): bool

Return Value:

PhpDriver::delete

PhpDriver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

PhpDriver::getCacheEntry

PhpDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

PhpDriver::has

PhpDriver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

PhpDriver::__debugInfo

PhpDriver::__debugInfo(  ): array

Return Value:

PSR16Driver

  • Full name: \NGSOFT\Cache\Drivers\PSR16Driver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

PSR16Driver::__construct

PSR16Driver::__construct( \Psr\SimpleCache\CacheInterface provider ): mixed

Parameters:

Parameter Type Description
provider \Psr\SimpleCache\CacheInterface

Return Value:

PSR16Driver::clear

PSR16Driver::clear(  ): bool

Return Value:

PSR16Driver::delete

PSR16Driver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

PSR16Driver::getCacheEntry

PSR16Driver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

PSR16Driver::has

PSR16Driver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

PSR16Driver::__debugInfo

PSR16Driver::__debugInfo(  ): array

Return Value:

PSR6Driver

  • Full name: \NGSOFT\Cache\Drivers\PSR6Driver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

PSR6Driver::__construct

PSR6Driver::__construct( \Psr\Cache\CacheItemPoolInterface provider ): mixed

Parameters:

Parameter Type Description
provider \Psr\Cache\CacheItemPoolInterface

Return Value:

PSR6Driver::getCacheEntry

PSR6Driver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

PSR6Driver::clear

PSR6Driver::clear(  ): bool

Return Value:

PSR6Driver::delete

PSR6Driver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

PSR6Driver::has

PSR6Driver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

PSR6Driver::__debugInfo

PSR6Driver::__debugInfo(  ): array

Return Value:

ReactCache

  • Full name: \NGSOFT\Cache\Adapters\ReactCache
  • This class implements: \NGSOFT\Cache, \React\Cache\CacheInterface, \Stringable, \Psr\Log\LoggerAwareInterface

ReactCache::__construct

ReactCache::__construct( \NGSOFT\Cache\Interfaces\CacheDriver driver, string prefix = '', int defaultLifetime ): mixed

Parameters:

Parameter Type Description
driver \NGSOFT\Cache\Interfaces\CacheDriver
prefix string
defaultLifetime int

Return Value:

ReactCache::setLogger

{@inheritdoc}

ReactCache::setLogger( \Psr\Log\LoggerInterface logger ): void

Parameters:

Parameter Type Description
logger \Psr\Log\LoggerInterface

Return Value:

ReactCache::increment

Increment the value of an item in the cache.

ReactCache::increment( string key, int value = 1 ): \React\Promise\PromiseInterface<int>

Parameters:

Parameter Type Description
key string
value int

Return Value:

new value

ReactCache::decrement

Decrement the value of an item in the cache.

ReactCache::decrement( string key, int value = 1 ): \React\Promise\PromiseInterface<int>

Parameters:

Parameter Type Description
key string
value int

Return Value:

new value

ReactCache::add

Adds data if it doesn't already exists

ReactCache::add( string key, mixed|\Closure value ): \React\Promise\PromiseInterface<bool>

Parameters:

Parameter Type Description
key string
value mixed|\Closure

Return Value:

True if the data have been added, false otherwise

ReactCache::clear

{@inheritdoc}

ReactCache::clear(  ): \React\Promise\PromiseInterface

Return Value:

ReactCache::delete

{@inheritdoc}

ReactCache::delete( mixed key ): \React\Promise\PromiseInterface

Parameters:

Parameter Type Description
key mixed

Return Value:

ReactCache::has

{@inheritdoc}

ReactCache::has( mixed key ): \React\Promise\PromiseInterface

Parameters:

Parameter Type Description
key mixed

Return Value:

ReactCache::get

{@inheritdoc}

ReactCache::get( mixed key, mixed default = null ): \React\Promise\PromiseInterface

Parameters:

Parameter Type Description
key mixed
default mixed

Return Value:

ReactCache::set

{@inheritdoc}

ReactCache::set( mixed key, mixed value, mixed ttl = null ): \React\Promise\PromiseInterface

Parameters:

Parameter Type Description
key mixed
value mixed
ttl mixed

Return Value:

ReactCache::deleteMultiple

{@inheritdoc}

ReactCache::deleteMultiple( array keys ): \React\Promise\PromiseInterface

Parameters:

Parameter Type Description
keys array

Return Value:

ReactCache::getMultiple

{@inheritdoc}

ReactCache::getMultiple( array keys, mixed default = null ): \React\Promise\PromiseInterface

Parameters:

Parameter Type Description
keys array
default mixed

Return Value:

ReactCache::setMultiple

{@inheritdoc}

ReactCache::setMultiple( array values, mixed ttl = null ): \React\Promise\PromiseInterface

Parameters:

Parameter Type Description
values array
ttl mixed

Return Value:

SimpleCachePool

PSR-6 to PSR-16 Adapter

  • Full name: \NGSOFT\Cache\Adapters\SimpleCachePool
  • This class implements: \Psr\SimpleCache\CacheInterface, \Psr\Log\LoggerAwareInterface, \Stringable, \NGSOFT\Cache

SimpleCachePool::__construct

SimpleCachePool::__construct( \Psr\Cache\CacheItemPoolInterface cachePool, ?int defaultLifetime = null ): mixed

Parameters:

Parameter Type Description
cachePool \Psr\Cache\CacheItemPoolInterface
defaultLifetime ?int

Return Value:

SimpleCachePool::getCachePool

{@inheritdoc}

SimpleCachePool::getCachePool(  ): \Psr\Cache\CacheItemPoolInterface

Return Value:

SimpleCachePool::increment

Increment the value of an item in the cache.

SimpleCachePool::increment( string key, int value = 1 ): int

Parameters:

Parameter Type Description
key string
value int

Return Value:

SimpleCachePool::decrement

Decrement the value of an item in the cache.

SimpleCachePool::decrement( string key, int value = 1 ): int

Parameters:

Parameter Type Description
key string
value int

Return Value:

SimpleCachePool::add

Adds data if it doesn't already exists

SimpleCachePool::add( string key, mixed|\Closure value ): bool

Parameters:

Parameter Type Description
key string
value mixed|\Closure

Return Value:

True if the data have been added, false otherwise

SimpleCachePool::clear

{@inheritdoc}

SimpleCachePool::clear(  ): bool

Return Value:

SimpleCachePool::delete

{@inheritdoc}

SimpleCachePool::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

SimpleCachePool::deleteMultiple

{@inheritdoc}

SimpleCachePool::deleteMultiple( iterable keys ): bool

Parameters:

Parameter Type Description
keys iterable

Return Value:

SimpleCachePool::get

{@inheritdoc}

SimpleCachePool::get( string key, mixed default = null ): mixed

Parameters:

Parameter Type Description
key string
default mixed

Return Value:

SimpleCachePool::getMultiple

{@inheritdoc}

SimpleCachePool::getMultiple( iterable keys, mixed default = null ): iterable

Parameters:

Parameter Type Description
keys iterable
default mixed

Return Value:

SimpleCachePool::has

{@inheritdoc}

SimpleCachePool::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

SimpleCachePool::set

{@inheritdoc}

SimpleCachePool::set( string key, mixed value, null|int|\DateInterval ttl = null ): bool

Parameters:

Parameter Type Description
key string
value mixed
ttl null|int|\DateInterval

Return Value:

SimpleCachePool::setMultiple

{@inheritdoc}

SimpleCachePool::setMultiple( iterable values, null|int|\DateInterval ttl = null ): bool

Parameters:

Parameter Type Description
values iterable
ttl null|int|\DateInterval

Return Value:

SimpleCachePool::__debugInfo

SimpleCachePool::__debugInfo(  ): array

Return Value:

SQLite3Adapter

  • Full name: \NGSOFT\Cache\Databases\SQLite\SQLite3Adapter
  • Parent class: \NGSOFT\Cache\Databases\SQLite\QueryEngine

SQLite3Adapter::__construct

SQLite3Adapter::__construct( \SQLite3 driver, string table ): mixed

Parameters:

Parameter Type Description
driver \SQLite3
table string

Return Value:

SQLite3Adapter::read

SQLite3Adapter::read( string key, bool data = true ): array|false

Parameters:

Parameter Type Description
key string
data bool

Return Value:

SQLite3Adapter::query

SQLite3Adapter::query( string query ): array|bool

Parameters:

Parameter Type Description
query string

Return Value:

Sqlite3Driver

  • Full name: \NGSOFT\Cache\Drivers\Sqlite3Driver
  • Parent class: \NGSOFT\Cache\Drivers\BaseDriver

Sqlite3Driver::__construct

Sqlite3Driver::__construct( \SQLite3|\PDO|string driver = '', string table = 'cache' ): mixed

Parameters:

Parameter Type Description
driver \SQLite3|\PDO|string A SQLite3 instance or a filename
table string

Return Value:

Sqlite3Driver::purge

Removes expired item entries if supported

Sqlite3Driver::purge(  ): void

Return Value:

Sqlite3Driver::clear

Sqlite3Driver::clear(  ): bool

Return Value:

Sqlite3Driver::delete

Sqlite3Driver::delete( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

Sqlite3Driver::getCacheEntry

Sqlite3Driver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry

Parameters:

Parameter Type Description
key string

Return Value:

Sqlite3Driver::has

Sqlite3Driver::has( string key ): bool

Parameters:

Parameter Type Description
key string

Return Value:

Sqlite3Driver::__debugInfo

Sqlite3Driver::__debugInfo(  ): array

Return Value: