PHPackages                             ngsoft/cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. ngsoft/cache

ActiveLibrary[Database &amp; ORM](/categories/database)

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.1(1y ago)0207MITPHPPHP &gt;=8.1

Since Jan 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ngsoft/cache)[ Packagist](https://packagist.org/packages/ngsoft/cache)[ RSS](/packages/ngsoft-cache/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (12)Versions (10)Used By (0)

Documentation
=============

[](#documentation)

Table of Contents
-----------------

[](#table-of-contents)

MethodDescription[**ApcuDriver**](#ApcuDriver)[ApcuDriver::isSupported](#ApcuDriverisSupported)[ApcuDriver::\_\_construct](#ApcuDriver__construct)[ApcuDriver::clear](#ApcuDriverclear)[ApcuDriver::delete](#ApcuDriverdelete)[ApcuDriver::getCacheEntry](#ApcuDrivergetCacheEntry)[ApcuDriver::has](#ApcuDriverhas)[ApcuDriver::\_\_debugInfo](#ApcuDriver__debugInfo)[**ArrayDriver**](#ArrayDriver)[ArrayDriver::\_\_construct](#ArrayDriver__construct)[ArrayDriver::clear](#ArrayDriverclear){@inheritdoc}[ArrayDriver::purge](#ArrayDriverpurge)Removes expired item entries if supported[ArrayDriver::delete](#ArrayDriverdelete){@inheritdoc}[ArrayDriver::getCacheEntry](#ArrayDrivergetCacheEntry){@inheritdoc}[ArrayDriver::has](#ArrayDriverhas){@inheritdoc}[ArrayDriver::\_\_debugInfo](#ArrayDriver__debugInfo)[**Cache**](#Cache)[Cache::invalidateTags](#CacheinvalidateTags)Invalidates cached items using tags.[Cache::purge](#Cachepurge)Removes expired item entries if supported[Cache::get](#Cacheget)Fetches a value from the pool or computes it if not found.[Cache::increment](#Cacheincrement)Increment the value of an item in the cache.[Cache::decrement](#Cachedecrement)Decrement the value of an item in the cache.[Cache::add](#Cacheadd)Adds data if it doesn't already exists[Cache::clear](#Cacheclear){@inheritdoc}[Cache::commit](#Cachecommit){@inheritdoc}[Cache::deleteItem](#CachedeleteItem){@inheritdoc}[Cache::deleteItems](#CachedeleteItems){@inheritdoc}[Cache::getItem](#CachegetItem){@inheritdoc}[Cache::getItems](#CachegetItems){@inheritdoc}[Cache::hasItem](#CachehasItem){@inheritdoc}[Cache::save](#Cachesave){@inheritdoc}[Cache::saveDeferred](#CachesaveDeferred){@inheritdoc}[Cache::lock](#Cachelock){@inheritdoc}[Cache::setPrefix](#CachesetPrefix)Change cache prefix[Cache::getDriver](#CachegetDriver)Access Cache driver directly[Cache::invalidate](#Cacheinvalidate)Increase prefix version, invalidating all prefixed entries[**CacheEntry**](#CacheEntry)[CacheEntry::\_\_construct](#CacheEntry__construct)[CacheEntry::getCacheItem](#CacheEntrygetCacheItem)[CacheEntry::isHit](#CacheEntryisHit)[CacheEntry::create](#CacheEntrycreate)[CacheEntry::createEmpty](#CacheEntrycreateEmpty)[CacheEntry::\_\_serialize](#CacheEntry__serialize)[CacheEntry::\_\_unserialize](#CacheEntry__unserialize)[CacheEntry::\_\_toString](#CacheEntry__toString)[**CacheError**](#CacheError)[**CacheEvent**](#CacheEvent)[CacheEvent::\_\_construct](#CacheEvent__construct)[CacheEvent::getCachePool](#CacheEventgetCachePool)[**CacheHit**](#CacheHit)[CacheHit::\_\_construct](#CacheHit__construct)[**CacheItem**](#CacheItem)A Cache Item[CacheItem::validateKey](#CacheItemvalidateKey)[CacheItem::create](#CacheItemcreate)[CacheItem::\_\_construct](#CacheItem__construct)[CacheItem::tag](#CacheItemtag)Adds a tag to a cache item.[CacheItem::getMetadata](#CacheItemgetMetadata)Returns a list of metadata info that were saved alongside with the cached value.[CacheItem::expiresAfter](#CacheItemexpiresAfter){@inheritdoc}[CacheItem::expiresAt](#CacheItemexpiresAt){@inheritdoc}[CacheItem::get](#CacheItemget){@inheritdoc}[CacheItem::getKey](#CacheItemgetKey){@inheritdoc}[CacheItem::isHit](#CacheItemisHit){@inheritdoc}[CacheItem::set](#CacheItemset){@inheritdoc}[CacheItem::\_\_clone](#CacheItem__clone){@inheritdoc}[CacheItem::\_\_debugInfo](#CacheItem__debugInfo)[**CacheMiss**](#CacheMiss)[**CachePool**](#CachePool)A PSR-6 cache pool[CachePool::\_\_construct](#CachePool__construct)[CachePool::\_\_destruct](#CachePool__destruct)[CachePool::\_\_debugInfo](#CachePool__debugInfo)[CachePool::setLogger](#CachePoolsetLogger)[CachePool::invalidateTags](#CachePoolinvalidateTags)Invalidates cached items using tags.[CachePool::purge](#CachePoolpurge)Removes expired item entries if supported[CachePool::get](#CachePoolget)Fetches a value from the pool or computes it if not found.[CachePool::increment](#CachePoolincrement)Increment the value of an item in the cache.[CachePool::decrement](#CachePooldecrement)Decrement the value of an item in the cache.[CachePool::add](#CachePooladd)Adds data if it doesn't already exists[CachePool::clear](#CachePoolclear){@inheritdoc}[CachePool::commit](#CachePoolcommit){@inheritdoc}[CachePool::deleteItem](#CachePooldeleteItem){@inheritdoc}[CachePool::deleteItems](#CachePooldeleteItems){@inheritdoc}[CachePool::getItem](#CachePoolgetItem){@inheritdoc}[CachePool::getItems](#CachePoolgetItems){@inheritdoc}[CachePool::hasItem](#CachePoolhasItem){@inheritdoc}[CachePool::save](#CachePoolsave){@inheritdoc}[CachePool::saveDeferred](#CachePoolsaveDeferred){@inheritdoc}[CachePool::lock](#CachePoollock){@inheritdoc}[**ChainDriver**](#ChainDriver)[ChainDriver::\_\_construct](#ChainDriver__construct)[ChainDriver::setDefaultLifetime](#ChainDriversetDefaultLifetime)set the default ttl[ChainDriver::count](#ChainDrivercount)[ChainDriver::getIterator](#ChainDrivergetIterator)[ChainDriver::getReverseIterator](#ChainDrivergetReverseIterator)[ChainDriver::set](#ChainDriverset)Persists data in the cache[ChainDriver::purge](#ChainDriverpurge)Removes expired item entries if supported[ChainDriver::clear](#ChainDriverclear)[ChainDriver::delete](#ChainDriverdelete)[ChainDriver::getCacheEntry](#ChainDrivergetCacheEntry)[ChainDriver::has](#ChainDriverhas)[ChainDriver::\_\_debugInfo](#ChainDriver__debugInfo)[**DoctrineCacheProvider**](#DoctrineCacheProvider)[DoctrineCacheProvider::\_\_construct](#DoctrineCacheProvider__construct)[DoctrineCacheProvider::getNamespace](#DoctrineCacheProvidergetNamespace)[DoctrineCacheProvider::setNamespace](#DoctrineCacheProvidersetNamespace)[DoctrineCacheProvider::setLogger](#DoctrineCacheProvidersetLogger){@inheritdoc}[DoctrineCacheProvider::contains](#DoctrineCacheProvidercontains){@inheritdoc}[DoctrineCacheProvider::delete](#DoctrineCacheProviderdelete){@inheritdoc}[DoctrineCacheProvider::fetch](#DoctrineCacheProviderfetch){@inheritdoc}[DoctrineCacheProvider::save](#DoctrineCacheProvidersave){@inheritdoc}[DoctrineCacheProvider::deleteAll](#DoctrineCacheProviderdeleteAll){@inheritdoc}[DoctrineCacheProvider::flushAll](#DoctrineCacheProviderflushAll){@inheritdoc}[DoctrineCacheProvider::deleteMultiple](#DoctrineCacheProviderdeleteMultiple){@inheritdoc}[DoctrineCacheProvider::fetchMultiple](#DoctrineCacheProviderfetchMultiple){@inheritdoc}[DoctrineCacheProvider::saveMultiple](#DoctrineCacheProvidersaveMultiple){@inheritdoc}[DoctrineCacheProvider::getStats](#DoctrineCacheProvidergetStats)[**DoctrineDriver**](#DoctrineDriver)[DoctrineDriver::\_\_construct](#DoctrineDriver__construct)[DoctrineDriver::clear](#DoctrineDriverclear)[DoctrineDriver::delete](#DoctrineDriverdelete)[DoctrineDriver::getCacheEntry](#DoctrineDrivergetCacheEntry)[DoctrineDriver::has](#DoctrineDriverhas)[DoctrineDriver::\_\_debugInfo](#DoctrineDriver__debugInfo)[**FileCache**](#FileCache)[FileCache::invalidateTags](#FileCacheinvalidateTags)Invalidates cached items using tags.[FileCache::purge](#FileCachepurge)Removes expired item entries if supported[FileCache::get](#FileCacheget)Fetches a value from the pool or computes it if not found.[FileCache::increment](#FileCacheincrement)Increment the value of an item in the cache.[FileCache::decrement](#FileCachedecrement)Decrement the value of an item in the cache.[FileCache::add](#FileCacheadd)Adds data if it doesn't already exists[FileCache::clear](#FileCacheclear){@inheritdoc}[FileCache::commit](#FileCachecommit){@inheritdoc}[FileCache::deleteItem](#FileCachedeleteItem){@inheritdoc}[FileCache::deleteItems](#FileCachedeleteItems){@inheritdoc}[FileCache::getItem](#FileCachegetItem){@inheritdoc}[FileCache::getItems](#FileCachegetItems){@inheritdoc}[FileCache::hasItem](#FileCachehasItem){@inheritdoc}[FileCache::save](#FileCachesave){@inheritdoc}[FileCache::saveDeferred](#FileCachesaveDeferred){@inheritdoc}[FileCache::lock](#FileCachelock){@inheritdoc}[FileCache::setPrefix](#FileCachesetPrefix)Change cache prefix[FileCache::getDriver](#FileCachegetDriver)Access Cache driver directly[FileCache::invalidate](#FileCacheinvalidate)Increase prefix version, invalidating all prefixed entries[**FileDriver**](#FileDriver)The oldest cache driver that store binary datas[FileDriver::onWindows](#FileDriveronWindows)[FileDriver::\_\_construct](#FileDriver__construct)[FileDriver::\_\_destruct](#FileDriver__destruct)[FileDriver::purge](#FileDriverpurge)Removes expired item entries if supported[FileDriver::clear](#FileDriverclear)[FileDriver::delete](#FileDriverdelete)[FileDriver::getCacheEntry](#FileDrivergetCacheEntry)[FileDriver::has](#FileDriverhas)[FileDriver::\_\_debugInfo](#FileDriver__debugInfo)[**IlluminateDriver**](#IlluminateDriver)[IlluminateDriver::\_\_construct](#IlluminateDriver__construct)[IlluminateDriver::clear](#IlluminateDriverclear)[IlluminateDriver::delete](#IlluminateDriverdelete)[IlluminateDriver::getCacheEntry](#IlluminateDrivergetCacheEntry)[IlluminateDriver::has](#IlluminateDriverhas)[IlluminateDriver::\_\_debugInfo](#IlluminateDriver__debugInfo)[**InvalidArgument**](#InvalidArgument)[**JsonDriver**](#JsonDriver)A driver that can be used for Cli applicationsCan store data inside a json config file for example[JsonDriver::\_\_construct](#JsonDriver__construct)[JsonDriver::purge](#JsonDriverpurge)Removes expired item entries if supported[JsonDriver::clear](#JsonDriverclear)[JsonDriver::delete](#JsonDriverdelete)[JsonDriver::getCacheEntry](#JsonDrivergetCacheEntry)[JsonDriver::has](#JsonDriverhas)[JsonDriver::count](#JsonDrivercount)[JsonDriver::\_\_debugInfo](#JsonDriver__debugInfo)[**KeyDeleted**](#KeyDeleted)[**KeySaved**](#KeySaved)[KeySaved::\_\_construct](#KeySaved__construct)[**LaravelStore**](#LaravelStore)[LaravelStore::\_\_construct](#LaravelStore__construct)[LaravelStore::setLogger](#LaravelStoresetLogger){@inheritdoc}[LaravelStore::increment](#LaravelStoreincrement){@inheritdoc}[LaravelStore::decrement](#LaravelStoredecrement){@inheritdoc}[LaravelStore::flush](#LaravelStoreflush){@inheritdoc}[LaravelStore::forever](#LaravelStoreforever){@inheritdoc}[LaravelStore::forget](#LaravelStoreforget){@inheritdoc}[LaravelStore::get](#LaravelStoreget){@inheritdoc}[LaravelStore::getPrefix](#LaravelStoregetPrefix){@inheritdoc}[LaravelStore::many](#LaravelStoremany){@inheritdoc}[LaravelStore::put](#LaravelStoreput){@inheritdoc}[LaravelStore::putMany](#LaravelStoreputMany){@inheritdoc}[**NullDriver**](#NullDriver)[NullDriver::clear](#NullDriverclear)[NullDriver::delete](#NullDriverdelete)[NullDriver::getCacheEntry](#NullDrivergetCacheEntry)[NullDriver::has](#NullDriverhas)[**PDOAdapter**](#PDOAdapter)[PDOAdapter::\_\_construct](#PDOAdapter__construct)[PDOAdapter::read](#PDOAdapterread)[PDOAdapter::query](#PDOAdapterquery)[**PHPCache**](#PHPCache)A preconfigured cache poolChains ArrayDriver, ApcuDriver, PhpDriver[PHPCache::\_\_construct](#PHPCache__construct)[PHPCache::appendDriver](#PHPCacheappendDriver)Put a driver at the end of the chain[PHPCache::prependDriver](#PHPCacheprependDriver)Put a driver at the beginning of the chain[**PhpDriver**](#PhpDriver)[PhpDriver::opCacheSupported](#PhpDriveropCacheSupported)[PhpDriver::onWindows](#PhpDriveronWindows)[PhpDriver::\_\_construct](#PhpDriver__construct)[PhpDriver::\_\_destruct](#PhpDriver__destruct)[PhpDriver::purge](#PhpDriverpurge)Removes expired item entries if supported[PhpDriver::clear](#PhpDriverclear)[PhpDriver::delete](#PhpDriverdelete)[PhpDriver::getCacheEntry](#PhpDrivergetCacheEntry)[PhpDriver::has](#PhpDriverhas)[PhpDriver::\_\_debugInfo](#PhpDriver__debugInfo)[**PSR16Driver**](#PSR16Driver)[PSR16Driver::\_\_construct](#PSR16Driver__construct)[PSR16Driver::clear](#PSR16Driverclear)[PSR16Driver::delete](#PSR16Driverdelete)[PSR16Driver::getCacheEntry](#PSR16DrivergetCacheEntry)[PSR16Driver::has](#PSR16Driverhas)[PSR16Driver::\_\_debugInfo](#PSR16Driver__debugInfo)[**PSR6Driver**](#PSR6Driver)[PSR6Driver::\_\_construct](#PSR6Driver__construct)[PSR6Driver::getCacheEntry](#PSR6DrivergetCacheEntry)[PSR6Driver::clear](#PSR6Driverclear)[PSR6Driver::delete](#PSR6Driverdelete)[PSR6Driver::has](#PSR6Driverhas)[PSR6Driver::\_\_debugInfo](#PSR6Driver__debugInfo)[**ReactCache**](#ReactCache)[ReactCache::\_\_construct](#ReactCache__construct)[ReactCache::setLogger](#ReactCachesetLogger){@inheritdoc}[ReactCache::increment](#ReactCacheincrement)Increment the value of an item in the cache.[ReactCache::decrement](#ReactCachedecrement)Decrement the value of an item in the cache.[ReactCache::add](#ReactCacheadd)Adds data if it doesn't already exists[ReactCache::clear](#ReactCacheclear){@inheritdoc}[ReactCache::delete](#ReactCachedelete){@inheritdoc}[ReactCache::has](#ReactCachehas){@inheritdoc}[ReactCache::get](#ReactCacheget){@inheritdoc}[ReactCache::set](#ReactCacheset){@inheritdoc}[ReactCache::deleteMultiple](#ReactCachedeleteMultiple){@inheritdoc}[ReactCache::getMultiple](#ReactCachegetMultiple){@inheritdoc}[ReactCache::setMultiple](#ReactCachesetMultiple){@inheritdoc}[**SimpleCachePool**](#SimpleCachePool)PSR-6 to PSR-16 Adapter[SimpleCachePool::\_\_construct](#SimpleCachePool__construct)[SimpleCachePool::getCachePool](#SimpleCachePoolgetCachePool){@inheritdoc}[SimpleCachePool::increment](#SimpleCachePoolincrement)Increment the value of an item in the cache.[SimpleCachePool::decrement](#SimpleCachePooldecrement)Decrement the value of an item in the cache.[SimpleCachePool::add](#SimpleCachePooladd)Adds data if it doesn't already exists[SimpleCachePool::clear](#SimpleCachePoolclear){@inheritdoc}[SimpleCachePool::delete](#SimpleCachePooldelete){@inheritdoc}[SimpleCachePool::deleteMultiple](#SimpleCachePooldeleteMultiple){@inheritdoc}[SimpleCachePool::get](#SimpleCachePoolget){@inheritdoc}[SimpleCachePool::getMultiple](#SimpleCachePoolgetMultiple){@inheritdoc}[SimpleCachePool::has](#SimpleCachePoolhas){@inheritdoc}[SimpleCachePool::set](#SimpleCachePoolset){@inheritdoc}[SimpleCachePool::setMultiple](#SimpleCachePoolsetMultiple){@inheritdoc}[SimpleCachePool::\_\_debugInfo](#SimpleCachePool__debugInfo)[**SQLite3Adapter**](#SQLite3Adapter)[SQLite3Adapter::\_\_construct](#SQLite3Adapter__construct)[SQLite3Adapter::read](#SQLite3Adapterread)[SQLite3Adapter::query](#SQLite3Adapterquery)[**Sqlite3Driver**](#Sqlite3Driver)[Sqlite3Driver::\_\_construct](#Sqlite3Driver__construct)[Sqlite3Driver::purge](#Sqlite3Driverpurge)Removes expired item entries if supported[Sqlite3Driver::clear](#Sqlite3Driverclear)[Sqlite3Driver::delete](#Sqlite3Driverdelete)[Sqlite3Driver::getCacheEntry](#Sqlite3DrivergetCacheEntry)[Sqlite3Driver::has](#Sqlite3Driverhas)[Sqlite3Driver::\_\_debugInfo](#Sqlite3Driver__debugInfo)ApcuDriver
----------

[](#apcudriver)

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

### ApcuDriver::isSupported

[](#apcudriverissupported)

```
ApcuDriver::isSupported(  ): bool
```

- This method is **static**.

**Return Value:**

---

### ApcuDriver::\_\_construct

[](#apcudriver__construct)

```
ApcuDriver::__construct(  ): mixed
```

**Return Value:**

---

### ApcuDriver::clear

[](#apcudriverclear)

```
ApcuDriver::clear(  ): bool
```

**Return Value:**

---

### ApcuDriver::delete

[](#apcudriverdelete)

```
ApcuDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ApcuDriver::getCacheEntry

[](#apcudrivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ApcuDriver::has

[](#apcudriverhas)

```
ApcuDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ApcuDriver::\_\_debugInfo

[](#apcudriver__debuginfo)

```
ApcuDriver::__debugInfo(  ): array
```

**Return Value:**

---

ArrayDriver
-----------

[](#arraydriver)

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

### ArrayDriver::\_\_construct

[](#arraydriver__construct)

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

**Parameters:**

ParameterTypeDescription`size`**int****Return Value:**

---

### ArrayDriver::clear

[](#arraydriverclear)

{@inheritdoc}

```
ArrayDriver::clear(  ): bool
```

**Return Value:**

---

### ArrayDriver::purge

[](#arraydriverpurge)

Removes expired item entries if supported

```
ArrayDriver::purge(  ): void
```

**Return Value:**

---

### ArrayDriver::delete

[](#arraydriverdelete)

{@inheritdoc}

```
ArrayDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ArrayDriver::getCacheEntry

[](#arraydrivergetcacheentry)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ArrayDriver::has

[](#arraydriverhas)

{@inheritdoc}

```
ArrayDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ArrayDriver::\_\_debugInfo

[](#arraydriver__debuginfo)

```
ArrayDriver::__debugInfo(  ): array
```

**Return Value:**

---

Cache
-----

[](#cache)

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

### Cache::invalidateTags

[](#cacheinvalidatetags)

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:**

ParameterTypeDescription`tags`**string\[\]|string**An array of tags to invalidate**Return Value:**

True on success

---

### Cache::purge

[](#cachepurge)

Removes expired item entries if supported

```
Cache::purge(  ): void
```

- This method is **static**.

**Return Value:**

---

### Cache::get

[](#cacheget)

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:**

ParameterTypeDescription`key`**string**`default`**mixed|\\Closure**if set the item will be saved with that value**Return Value:**

---

### Cache::increment

[](#cacheincrement)

Increment the value of an item in the cache.

```
Cache::increment( string key, int value = 1 ): int
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

---

### Cache::decrement

[](#cachedecrement)

Decrement the value of an item in the cache.

```
Cache::decrement( string key, int value = 1 ): int
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

---

### Cache::add

[](#cacheadd)

Adds data if it doesn't already exists

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

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string**`value`**mixed|\\Closure****Return Value:**

True if the data have been added, false otherwise

---

### Cache::clear

[](#cacheclear)

{@inheritdoc}

```
Cache::clear(  ): bool
```

- This method is **static**.

**Return Value:**

---

### Cache::commit

[](#cachecommit)

{@inheritdoc}

```
Cache::commit(  ): bool
```

- This method is **static**.

**Return Value:**

---

### Cache::deleteItem

[](#cachedeleteitem)

{@inheritdoc}

```
Cache::deleteItem( string key ): bool
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### Cache::deleteItems

[](#cachedeleteitems)

{@inheritdoc}

```
Cache::deleteItems( array keys ): bool
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### Cache::getItem

[](#cachegetitem)

{@inheritdoc}

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

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### Cache::getItems

[](#cachegetitems)

{@inheritdoc}

```
Cache::getItems( array keys = [] ): iterable
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### Cache::hasItem

[](#cachehasitem)

{@inheritdoc}

```
Cache::hasItem( string key ): bool
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### Cache::save

[](#cachesave)

{@inheritdoc}

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

- This method is **static**. **Parameters:**

ParameterTypeDescription`item`**\\Psr\\Cache\\CacheItemInterface****Return Value:**

---

### Cache::saveDeferred

[](#cachesavedeferred)

{@inheritdoc}

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

- This method is **static**. **Parameters:**

ParameterTypeDescription`item`**\\Psr\\Cache\\CacheItemInterface****Return Value:**

---

### Cache::lock

[](#cachelock)

{@inheritdoc}

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

- This method is **static**. **Parameters:**

ParameterTypeDescription`name`**string**`seconds`**int|float**`owner`**string****Return Value:**

---

### Cache::setPrefix

[](#cachesetprefix)

Change cache prefix

```
Cache::setPrefix( string prefix ): void
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`prefix`**string****Return Value:**

---

### Cache::getDriver

[](#cachegetdriver)

Access Cache driver directly

```
Cache::getDriver(  ): \NGSOFT\Cache\Interfaces\CacheDriver
```

- This method is **static**.

**Return Value:**

---

### Cache::invalidate

[](#cacheinvalidate)

Increase prefix version, invalidating all prefixed entries

```
Cache::invalidate(  ): bool
```

- This method is **static**.

**Return Value:**

---

CacheEntry
----------

[](#cacheentry)

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

### CacheEntry::\_\_construct

[](#cacheentry__construct)

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

**Parameters:**

ParameterTypeDescription`key`**string**`expiry`**int**`value`**mixed**`tags`**array****Return Value:**

---

### CacheEntry::getCacheItem

[](#cacheentrygetcacheitem)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### CacheEntry::isHit

[](#cacheentryishit)

```
CacheEntry::isHit(  ): bool
```

**Return Value:**

---

### CacheEntry::create

[](#cacheentrycreate)

```
CacheEntry::create( string key, int expiry, mixed value, array tags ): static
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string**`expiry`**int**`value`**mixed**`tags`**array****Return Value:**

---

### CacheEntry::createEmpty

[](#cacheentrycreateempty)

```
CacheEntry::createEmpty( string key ): static
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### CacheEntry::\_\_serialize

[](#cacheentry__serialize)

```
CacheEntry::__serialize(  ): array
```

**Return Value:**

---

### CacheEntry::\_\_unserialize

[](#cacheentry__unserialize)

```
CacheEntry::__unserialize( array data ): void
```

**Parameters:**

ParameterTypeDescription`data`**array****Return Value:**

---

### CacheEntry::\_\_toString

[](#cacheentry__tostring)

```
CacheEntry::__toString(  ): string
```

**Return Value:**

---

CacheError
----------

[](#cacheerror)

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

CacheEvent
----------

[](#cacheevent)

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

### CacheEvent::\_\_construct

[](#cacheevent__construct)

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

**Parameters:**

ParameterTypeDescription`cachePool`**\\Psr\\Cache\\CacheItemPoolInterface**`key`**string****Return Value:**

---

### CacheEvent::getCachePool

[](#cacheeventgetcachepool)

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

**Return Value:**

---

CacheHit
--------

[](#cachehit)

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

### CacheHit::\_\_construct

[](#cachehit__construct)

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

**Parameters:**

ParameterTypeDescription`cachePool`**\\Psr\\Cache\\CacheItemPoolInterface**`key`**string**`value`**mixed****Return Value:**

---

CacheItem
---------

[](#cacheitem)

A Cache Item

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

### CacheItem::validateKey

[](#cacheitemvalidatekey)

```
CacheItem::validateKey( mixed key ): void
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**mixed****Return Value:**

---

### CacheItem::create

[](#cacheitemcreate)

```
CacheItem::create( string key, ?array metadata = null ): static
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string**`metadata`**?array****Return Value:**

---

### CacheItem::\_\_construct

[](#cacheitem__construct)

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

**Parameters:**

ParameterTypeDescription`key`**string**`metadata`**?array****Return Value:**

---

### CacheItem::tag

[](#cacheitemtag)

Adds a tag to a cache item.

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

**Parameters:**

ParameterTypeDescription`tags`**string|iterable**A tag or array of tags**Return Value:**

---

### CacheItem::getMetadata

[](#cacheitemgetmetadata)

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

```
CacheItem::getMetadata(  ): array
```

**Return Value:**

---

### CacheItem::expiresAfter

[](#cacheitemexpiresafter)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`time`**int|\\DateInterval|null****Return Value:**

---

### CacheItem::expiresAt

[](#cacheitemexpiresat)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`expiration`**?\\DateTimeInterface****Return Value:**

---

### CacheItem::get

[](#cacheitemget)

{@inheritdoc}

```
CacheItem::get(  ): mixed
```

**Return Value:**

---

### CacheItem::getKey

[](#cacheitemgetkey)

{@inheritdoc}

```
CacheItem::getKey(  ): string
```

**Return Value:**

---

### CacheItem::isHit

[](#cacheitemishit)

{@inheritdoc}

```
CacheItem::isHit(  ): bool
```

**Return Value:**

---

### CacheItem::set

[](#cacheitemset)

{@inheritdoc}

```
CacheItem::set( mixed value ): static
```

**Parameters:**

ParameterTypeDescription`value`**mixed****Return Value:**

---

### CacheItem::\_\_clone

[](#cacheitem__clone)

{@inheritdoc}

```
CacheItem::__clone(  ): void
```

**Return Value:**

---

### CacheItem::\_\_debugInfo

[](#cacheitem__debuginfo)

```
CacheItem::__debugInfo(  ): array
```

**Return Value:**

---

CacheMiss
---------

[](#cachemiss)

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

CachePool
---------

[](#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)

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

**Parameters:**

ParameterTypeDescription`driver`**\\NGSOFT\\Cache\\Interfaces\\CacheDriver**`prefix`**string**`defaultLifetime`**int**`logger`**?\\Psr\\Log\\LoggerInterface**`eventDispatcher`**?\\Psr\\EventDispatcher\\EventDispatcherInterface****Return Value:**

---

### CachePool::\_\_destruct

[](#cachepool__destruct)

```
CachePool::__destruct(  ): mixed
```

**Return Value:**

---

### CachePool::\_\_debugInfo

[](#cachepool__debuginfo)

```
CachePool::__debugInfo(  ): array
```

**Return Value:**

---

### CachePool::setLogger

[](#cachepoolsetlogger)

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

**Parameters:**

ParameterTypeDescription`logger`**\\Psr\\Log\\LoggerInterface****Return Value:**

---

### CachePool::invalidateTags

[](#cachepoolinvalidatetags)

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:**

ParameterTypeDescription`tags`**string\[\]|string**An array of tags to invalidate**Return Value:**

True on success

---

### CachePool::purge

[](#cachepoolpurge)

Removes expired item entries if supported

```
CachePool::purge(  ): void
```

**Return Value:**

---

### CachePool::get

[](#cachepoolget)

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

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

**Parameters:**

ParameterTypeDescription`key`**string**`default`**mixed|\\Closure**if set the item will be saved with that value**Return Value:**

---

### CachePool::increment

[](#cachepoolincrement)

Increment the value of an item in the cache.

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

**Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

---

### CachePool::decrement

[](#cachepooldecrement)

Decrement the value of an item in the cache.

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

**Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

---

### CachePool::add

[](#cachepooladd)

Adds data if it doesn't already exists

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

**Parameters:**

ParameterTypeDescription`key`**string**`value`**mixed|\\Closure****Return Value:**

True if the data have been added, false otherwise

---

### CachePool::clear

[](#cachepoolclear)

{@inheritdoc}

```
CachePool::clear(  ): bool
```

**Return Value:**

---

### CachePool::commit

[](#cachepoolcommit)

{@inheritdoc}

```
CachePool::commit(  ): bool
```

**Return Value:**

---

### CachePool::deleteItem

[](#cachepooldeleteitem)

{@inheritdoc}

```
CachePool::deleteItem( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### CachePool::deleteItems

[](#cachepooldeleteitems)

{@inheritdoc}

```
CachePool::deleteItems( array keys ): bool
```

**Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### CachePool::getItem

[](#cachepoolgetitem)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### CachePool::getItems

[](#cachepoolgetitems)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### CachePool::hasItem

[](#cachepoolhasitem)

{@inheritdoc}

```
CachePool::hasItem( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### CachePool::save

[](#cachepoolsave)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`item`**\\Psr\\Cache\\CacheItemInterface****Return Value:**

---

### CachePool::saveDeferred

[](#cachepoolsavedeferred)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`item`**\\Psr\\Cache\\CacheItemInterface****Return Value:**

---

### CachePool::lock

[](#cachepoollock)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`name`**string**`seconds`**int|float**`owner`**string****Return Value:**

---

ChainDriver
-----------

[](#chaindriver)

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

### ChainDriver::\_\_construct

[](#chaindriver__construct)

```
ChainDriver::__construct( iterable drivers ): mixed
```

**Parameters:**

ParameterTypeDescription`drivers`**iterable****Return Value:**

---

### ChainDriver::setDefaultLifetime

[](#chaindriversetdefaultlifetime)

set the default ttl

```
ChainDriver::setDefaultLifetime( int defaultLifetime ): void
```

**Parameters:**

ParameterTypeDescription`defaultLifetime`**int****Return Value:**

---

### ChainDriver::count

[](#chaindrivercount)

```
ChainDriver::count(  ): int
```

**Return Value:**

---

### ChainDriver::getIterator

[](#chaindrivergetiterator)

```
ChainDriver::getIterator(  ): \Traversable
```

**Return Value:**

---

### ChainDriver::getReverseIterator

[](#chaindrivergetreverseiterator)

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

**Parameters:**

ParameterTypeDescription`current`**?int****Return Value:**

---

### ChainDriver::set

[](#chaindriverset)

Persists data in the cache

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

**Parameters:**

ParameterTypeDescription`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

[](#chaindriverpurge)

Removes expired item entries if supported

```
ChainDriver::purge(  ): void
```

**Return Value:**

---

### ChainDriver::clear

[](#chaindriverclear)

```
ChainDriver::clear(  ): bool
```

**Return Value:**

---

### ChainDriver::delete

[](#chaindriverdelete)

```
ChainDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ChainDriver::getCacheEntry

[](#chaindrivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ChainDriver::has

[](#chaindriverhas)

```
ChainDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### ChainDriver::\_\_debugInfo

[](#chaindriver__debuginfo)

```
ChainDriver::__debugInfo(  ): array
```

**Return Value:**

---

DoctrineCacheProvider
---------------------

[](#doctrinecacheprovider)

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

### DoctrineCacheProvider::\_\_construct

[](#doctrinecacheprovider__construct)

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

**Parameters:**

ParameterTypeDescription`driver`**\\NGSOFT\\Cache\\Interfaces\\CacheDriver**`prefix`**string**`defaultLifetime`**int****Return Value:**

---

### DoctrineCacheProvider::getNamespace

[](#doctrinecacheprovidergetnamespace)

```
DoctrineCacheProvider::getNamespace(  ): string
```

**Return Value:**

---

### DoctrineCacheProvider::setNamespace

[](#doctrinecacheprovidersetnamespace)

```
DoctrineCacheProvider::setNamespace( mixed namespace ): void
```

**Parameters:**

ParameterTypeDescription`namespace`**mixed****Return Value:**

---

### DoctrineCacheProvider::setLogger

[](#doctrinecacheprovidersetlogger)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`logger`**\\Psr\\Log\\LoggerInterface****Return Value:**

---

### DoctrineCacheProvider::contains

[](#doctrinecacheprovidercontains)

{@inheritdoc}

```
DoctrineCacheProvider::contains( mixed id ): bool
```

**Parameters:**

ParameterTypeDescription`id`**mixed****Return Value:**

---

### DoctrineCacheProvider::delete

[](#doctrinecacheproviderdelete)

{@inheritdoc}

```
DoctrineCacheProvider::delete( mixed id ): bool
```

**Parameters:**

ParameterTypeDescription`id`**mixed****Return Value:**

---

### DoctrineCacheProvider::fetch

[](#doctrinecacheproviderfetch)

{@inheritdoc}

```
DoctrineCacheProvider::fetch( mixed id ): mixed
```

**Parameters:**

ParameterTypeDescription`id`**mixed****Return Value:**

---

### DoctrineCacheProvider::save

[](#doctrinecacheprovidersave)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`id`**mixed**`data`**mixed**`lifeTime`**mixed****Return Value:**

---

### DoctrineCacheProvider::deleteAll

[](#doctrinecacheproviderdeleteall)

{@inheritdoc}

```
DoctrineCacheProvider::deleteAll(  ): bool
```

**Return Value:**

---

### DoctrineCacheProvider::flushAll

[](#doctrinecacheproviderflushall)

{@inheritdoc}

```
DoctrineCacheProvider::flushAll(  ): bool
```

**Return Value:**

---

### DoctrineCacheProvider::deleteMultiple

[](#doctrinecacheproviderdeletemultiple)

{@inheritdoc}

```
DoctrineCacheProvider::deleteMultiple( array keys ): bool
```

**Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### DoctrineCacheProvider::fetchMultiple

[](#doctrinecacheproviderfetchmultiple)

{@inheritdoc}

```
DoctrineCacheProvider::fetchMultiple( array keys ): array
```

**Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### DoctrineCacheProvider::saveMultiple

[](#doctrinecacheprovidersavemultiple)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`keysAndValues`**array**`lifetime`**mixed****Return Value:**

---

### DoctrineCacheProvider::getStats

[](#doctrinecacheprovidergetstats)

```
DoctrineCacheProvider::getStats(  ): mixed
```

**Return Value:**

---

DoctrineDriver
--------------

[](#doctrinedriver)

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

### DoctrineDriver::\_\_construct

[](#doctrinedriver__construct)

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

**Parameters:**

ParameterTypeDescription`provider`**\\Doctrine\\Common\\Cache\\CacheProvider****Return Value:**

---

### DoctrineDriver::clear

[](#doctrinedriverclear)

```
DoctrineDriver::clear(  ): bool
```

**Return Value:**

---

### DoctrineDriver::delete

[](#doctrinedriverdelete)

```
DoctrineDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### DoctrineDriver::getCacheEntry

[](#doctrinedrivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### DoctrineDriver::has

[](#doctrinedriverhas)

```
DoctrineDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### DoctrineDriver::\_\_debugInfo

[](#doctrinedriver__debuginfo)

```
DoctrineDriver::__debugInfo(  ): array
```

**Return Value:**

---

FileCache
---------

[](#filecache)

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

### FileCache::invalidateTags

[](#filecacheinvalidatetags)

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:**

ParameterTypeDescription`tags`**string\[\]|string**An array of tags to invalidate**Return Value:**

True on success

---

### FileCache::purge

[](#filecachepurge)

Removes expired item entries if supported

```
FileCache::purge(  ): void
```

- This method is **static**.

**Return Value:**

---

### FileCache::get

[](#filecacheget)

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:**

ParameterTypeDescription`key`**string**`default`**mixed|\\Closure**if set the item will be saved with that value**Return Value:**

---

### FileCache::increment

[](#filecacheincrement)

Increment the value of an item in the cache.

```
FileCache::increment( string key, int value = 1 ): int
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

---

### FileCache::decrement

[](#filecachedecrement)

Decrement the value of an item in the cache.

```
FileCache::decrement( string key, int value = 1 ): int
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

---

### FileCache::add

[](#filecacheadd)

Adds data if it doesn't already exists

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

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string**`value`**mixed|\\Closure****Return Value:**

True if the data have been added, false otherwise

---

### FileCache::clear

[](#filecacheclear)

{@inheritdoc}

```
FileCache::clear(  ): bool
```

- This method is **static**.

**Return Value:**

---

### FileCache::commit

[](#filecachecommit)

{@inheritdoc}

```
FileCache::commit(  ): bool
```

- This method is **static**.

**Return Value:**

---

### FileCache::deleteItem

[](#filecachedeleteitem)

{@inheritdoc}

```
FileCache::deleteItem( string key ): bool
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### FileCache::deleteItems

[](#filecachedeleteitems)

{@inheritdoc}

```
FileCache::deleteItems( array keys ): bool
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### FileCache::getItem

[](#filecachegetitem)

{@inheritdoc}

```
FileCache::getItem( string key ): \NGSOFT\Cache\Interfaces\TaggableCacheItem
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### FileCache::getItems

[](#filecachegetitems)

{@inheritdoc}

```
FileCache::getItems( array keys = [] ): iterable
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### FileCache::hasItem

[](#filecachehasitem)

{@inheritdoc}

```
FileCache::hasItem( string key ): bool
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### FileCache::save

[](#filecachesave)

{@inheritdoc}

```
FileCache::save( \Psr\Cache\CacheItemInterface item ): bool
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`item`**\\Psr\\Cache\\CacheItemInterface****Return Value:**

---

### FileCache::saveDeferred

[](#filecachesavedeferred)

{@inheritdoc}

```
FileCache::saveDeferred( \Psr\Cache\CacheItemInterface item ): bool
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`item`**\\Psr\\Cache\\CacheItemInterface****Return Value:**

---

### FileCache::lock

[](#filecachelock)

{@inheritdoc}

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

- This method is **static**. **Parameters:**

ParameterTypeDescription`name`**string**`seconds`**int|float**`owner`**string****Return Value:**

---

### FileCache::setPrefix

[](#filecachesetprefix)

Change cache prefix

```
FileCache::setPrefix( string prefix ): void
```

- This method is **static**. **Parameters:**

ParameterTypeDescription`prefix`**string****Return Value:**

---

### FileCache::getDriver

[](#filecachegetdriver)

Access Cache driver directly

```
FileCache::getDriver(  ): \NGSOFT\Cache\Interfaces\CacheDriver
```

- This method is **static**.

**Return Value:**

---

### FileCache::invalidate

[](#filecacheinvalidate)

Increase prefix version, invalidating all prefixed entries

```
FileCache::invalidate(  ): bool
```

- This method is **static**.

**Return Value:**

---

FileDriver
----------

[](#filedriver)

The oldest cache driver that store binary datas

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

### FileDriver::onWindows

[](#filedriveronwindows)

```
FileDriver::onWindows(  ): bool
```

- This method is **static**.

**Return Value:**

---

### FileDriver::\_\_construct

[](#filedriver__construct)

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

**Parameters:**

ParameterTypeDescription`root`**string**`prefix`**string****Return Value:**

---

### FileDriver::\_\_destruct

[](#filedriver__destruct)

```
FileDriver::__destruct(  ): mixed
```

**Return Value:**

---

### FileDriver::purge

[](#filedriverpurge)

Removes expired item entries if supported

```
FileDriver::purge(  ): void
```

**Return Value:**

---

### FileDriver::clear

[](#filedriverclear)

```
FileDriver::clear(  ): bool
```

**Return Value:**

---

### FileDriver::delete

[](#filedriverdelete)

```
FileDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### FileDriver::getCacheEntry

[](#filedrivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### FileDriver::has

[](#filedriverhas)

```
FileDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### FileDriver::\_\_debugInfo

[](#filedriver__debuginfo)

```
FileDriver::__debugInfo(  ): array
```

**Return Value:**

---

IlluminateDriver
----------------

[](#illuminatedriver)

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

### IlluminateDriver::\_\_construct

[](#illuminatedriver__construct)

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

**Parameters:**

ParameterTypeDescription`provider`**\\Illuminate\\Contracts\\Cache\\Store****Return Value:**

---

### IlluminateDriver::clear

[](#illuminatedriverclear)

```
IlluminateDriver::clear(  ): bool
```

**Return Value:**

---

### IlluminateDriver::delete

[](#illuminatedriverdelete)

```
IlluminateDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### IlluminateDriver::getCacheEntry

[](#illuminatedrivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### IlluminateDriver::has

[](#illuminatedriverhas)

```
IlluminateDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### IlluminateDriver::\_\_debugInfo

[](#illuminatedriver__debuginfo)

```
IlluminateDriver::__debugInfo(  ): array
```

**Return Value:**

---

InvalidArgument
---------------

[](#invalidargument)

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

JsonDriver
----------

[](#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)

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

**Parameters:**

ParameterTypeDescription`file`**string|\\NGSOFT\\Filesystem\\File**`key`**string**Key to use inside the object**Return Value:**

---

### JsonDriver::purge

[](#jsondriverpurge)

Removes expired item entries if supported

```
JsonDriver::purge(  ): void
```

**Return Value:**

---

### JsonDriver::clear

[](#jsondriverclear)

```
JsonDriver::clear(  ): bool
```

**Return Value:**

---

### JsonDriver::delete

[](#jsondriverdelete)

```
JsonDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### JsonDriver::getCacheEntry

[](#jsondrivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### JsonDriver::has

[](#jsondriverhas)

```
JsonDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### JsonDriver::count

[](#jsondrivercount)

```
JsonDriver::count(  ): int
```

**Return Value:**

---

### JsonDriver::\_\_debugInfo

[](#jsondriver__debuginfo)

```
JsonDriver::__debugInfo(  ): array
```

**Return Value:**

---

KeyDeleted
----------

[](#keydeleted)

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

KeySaved
--------

[](#keysaved)

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

### KeySaved::\_\_construct

[](#keysaved__construct)

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

**Parameters:**

ParameterTypeDescription`cachePool`**\\Psr\\Cache\\CacheItemPoolInterface**`key`**string**`value`**mixed****Return Value:**

---

LaravelStore
------------

[](#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)

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

**Parameters:**

ParameterTypeDescription`driver`**\\NGSOFT\\Cache\\Interfaces\\CacheDriver**`prefix`**string**`defaultLifetime`**int****Return Value:**

---

### LaravelStore::setLogger

[](#laravelstoresetlogger)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`logger`**\\Psr\\Log\\LoggerInterface****Return Value:**

---

### LaravelStore::increment

[](#laravelstoreincrement)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**mixed**`value`**mixed****Return Value:**

---

### LaravelStore::decrement

[](#laravelstoredecrement)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**mixed**`value`**mixed****Return Value:**

---

### LaravelStore::flush

[](#laravelstoreflush)

{@inheritdoc}

```
LaravelStore::flush(  ): bool
```

**Return Value:**

---

### LaravelStore::forever

[](#laravelstoreforever)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**mixed**`value`**mixed****Return Value:**

---

### LaravelStore::forget

[](#laravelstoreforget)

{@inheritdoc}

```
LaravelStore::forget( mixed key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**mixed****Return Value:**

---

### LaravelStore::get

[](#laravelstoreget)

{@inheritdoc}

```
LaravelStore::get( mixed key ): mixed
```

**Parameters:**

ParameterTypeDescription`key`**mixed****Return Value:**

---

### LaravelStore::getPrefix

[](#laravelstoregetprefix)

{@inheritdoc}

```
LaravelStore::getPrefix(  ): string
```

**Return Value:**

---

### LaravelStore::many

[](#laravelstoremany)

{@inheritdoc}

```
LaravelStore::many( array keys ): array
```

**Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### LaravelStore::put

[](#laravelstoreput)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**mixed**`value`**mixed**`seconds`**mixed****Return Value:**

---

### LaravelStore::putMany

[](#laravelstoreputmany)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`values`**array**`seconds`**mixed****Return Value:**

---

NullDriver
----------

[](#nulldriver)

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

### NullDriver::clear

[](#nulldriverclear)

```
NullDriver::clear(  ): bool
```

**Return Value:**

---

### NullDriver::delete

[](#nulldriverdelete)

```
NullDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### NullDriver::getCacheEntry

[](#nulldrivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### NullDriver::has

[](#nulldriverhas)

```
NullDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

PDOAdapter
----------

[](#pdoadapter)

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

### PDOAdapter::\_\_construct

[](#pdoadapter__construct)

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

**Parameters:**

ParameterTypeDescription`driver`**\\PDO**`table`**string****Return Value:**

---

### PDOAdapter::read

[](#pdoadapterread)

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

**Parameters:**

ParameterTypeDescription`key`**string**`data`**bool****Return Value:**

---

### PDOAdapter::query

[](#pdoadapterquery)

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

**Parameters:**

ParameterTypeDescription`query`**string****Return Value:**

---

PHPCache
--------

[](#phpcache)

A preconfigured cache pool Chains ArrayDriver, ApcuDriver, PhpDriver

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

### PHPCache::\_\_construct

[](#phpcache__construct)

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

**Parameters:**

ParameterTypeDescription`rootpath`**string**`prefix`**string**`defaultLifetime`**int**`logger`**?\\Psr\\Log\\LoggerInterface**`eventDispatcher`**?\\Psr\\EventDispatcher\\EventDispatcherInterface****Return Value:**

---

### PHPCache::appendDriver

[](#phpcacheappenddriver)

Put a driver at the end of the chain

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

**Parameters:**

ParameterTypeDescription`driver`**\\NGSOFT\\Cache\\Interfaces\\CacheDriver****Return Value:**

---

### PHPCache::prependDriver

[](#phpcacheprependdriver)

Put a driver at the beginning of the chain

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

**Parameters:**

ParameterTypeDescription`driver`**\\NGSOFT\\Cache\\Interfaces\\CacheDriver****Return Value:**

---

PhpDriver
---------

[](#phpdriver)

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

### PhpDriver::opCacheSupported

[](#phpdriveropcachesupported)

```
PhpDriver::opCacheSupported(  ): bool
```

- This method is **static**.

**Return Value:**

---

### PhpDriver::onWindows

[](#phpdriveronwindows)

```
PhpDriver::onWindows(  ): bool
```

- This method is **static**.

**Return Value:**

---

### PhpDriver::\_\_construct

[](#phpdriver__construct)

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

**Parameters:**

ParameterTypeDescription`root`**string**`prefix`**string****Return Value:**

---

### PhpDriver::\_\_destruct

[](#phpdriver__destruct)

```
PhpDriver::__destruct(  ): mixed
```

**Return Value:**

---

### PhpDriver::purge

[](#phpdriverpurge)

Removes expired item entries if supported

```
PhpDriver::purge(  ): void
```

**Return Value:**

---

### PhpDriver::clear

[](#phpdriverclear)

```
PhpDriver::clear(  ): bool
```

**Return Value:**

---

### PhpDriver::delete

[](#phpdriverdelete)

```
PhpDriver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PhpDriver::getCacheEntry

[](#phpdrivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PhpDriver::has

[](#phpdriverhas)

```
PhpDriver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PhpDriver::\_\_debugInfo

[](#phpdriver__debuginfo)

```
PhpDriver::__debugInfo(  ): array
```

**Return Value:**

---

PSR16Driver
-----------

[](#psr16driver)

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

### PSR16Driver::\_\_construct

[](#psr16driver__construct)

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

**Parameters:**

ParameterTypeDescription`provider`**\\Psr\\SimpleCache\\CacheInterface****Return Value:**

---

### PSR16Driver::clear

[](#psr16driverclear)

```
PSR16Driver::clear(  ): bool
```

**Return Value:**

---

### PSR16Driver::delete

[](#psr16driverdelete)

```
PSR16Driver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PSR16Driver::getCacheEntry

[](#psr16drivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PSR16Driver::has

[](#psr16driverhas)

```
PSR16Driver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PSR16Driver::\_\_debugInfo

[](#psr16driver__debuginfo)

```
PSR16Driver::__debugInfo(  ): array
```

**Return Value:**

---

PSR6Driver
----------

[](#psr6driver)

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

### PSR6Driver::\_\_construct

[](#psr6driver__construct)

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

**Parameters:**

ParameterTypeDescription`provider`**\\Psr\\Cache\\CacheItemPoolInterface****Return Value:**

---

### PSR6Driver::getCacheEntry

[](#psr6drivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PSR6Driver::clear

[](#psr6driverclear)

```
PSR6Driver::clear(  ): bool
```

**Return Value:**

---

### PSR6Driver::delete

[](#psr6driverdelete)

```
PSR6Driver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PSR6Driver::has

[](#psr6driverhas)

```
PSR6Driver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### PSR6Driver::\_\_debugInfo

[](#psr6driver__debuginfo)

```
PSR6Driver::__debugInfo(  ): array
```

**Return Value:**

---

ReactCache
----------

[](#reactcache)

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

### ReactCache::\_\_construct

[](#reactcache__construct)

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

**Parameters:**

ParameterTypeDescription`driver`**\\NGSOFT\\Cache\\Interfaces\\CacheDriver**`prefix`**string**`defaultLifetime`**int****Return Value:**

---

### ReactCache::setLogger

[](#reactcachesetlogger)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`logger`**\\Psr\\Log\\LoggerInterface****Return Value:**

---

### ReactCache::increment

[](#reactcacheincrement)

Increment the value of an item in the cache.

```
ReactCache::increment( string key, int value = 1 ): \React\Promise\PromiseInterface&lt;int&gt;
```

**Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

new value

---

### ReactCache::decrement

[](#reactcachedecrement)

Decrement the value of an item in the cache.

```
ReactCache::decrement( string key, int value = 1 ): \React\Promise\PromiseInterface&lt;int&gt;
```

**Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

new value

---

### ReactCache::add

[](#reactcacheadd)

Adds data if it doesn't already exists

```
ReactCache::add( string key, mixed|\Closure value ): \React\Promise\PromiseInterface&lt;bool&gt;
```

**Parameters:**

ParameterTypeDescription`key`**string**`value`**mixed|\\Closure****Return Value:**

True if the data have been added, false otherwise

---

### ReactCache::clear

[](#reactcacheclear)

{@inheritdoc}

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

**Return Value:**

---

### ReactCache::delete

[](#reactcachedelete)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**mixed****Return Value:**

---

### ReactCache::has

[](#reactcachehas)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**mixed****Return Value:**

---

### ReactCache::get

[](#reactcacheget)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**mixed**`default`**mixed****Return Value:**

---

### ReactCache::set

[](#reactcacheset)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**mixed**`value`**mixed**`ttl`**mixed****Return Value:**

---

### ReactCache::deleteMultiple

[](#reactcachedeletemultiple)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`keys`**array****Return Value:**

---

### ReactCache::getMultiple

[](#reactcachegetmultiple)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`keys`**array**`default`**mixed****Return Value:**

---

### ReactCache::setMultiple

[](#reactcachesetmultiple)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`values`**array**`ttl`**mixed****Return Value:**

---

SimpleCachePool
---------------

[](#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)

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

**Parameters:**

ParameterTypeDescription`cachePool`**\\Psr\\Cache\\CacheItemPoolInterface**`defaultLifetime`**?int****Return Value:**

---

### SimpleCachePool::getCachePool

[](#simplecachepoolgetcachepool)

{@inheritdoc}

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

**Return Value:**

---

### SimpleCachePool::increment

[](#simplecachepoolincrement)

Increment the value of an item in the cache.

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

**Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

---

### SimpleCachePool::decrement

[](#simplecachepooldecrement)

Decrement the value of an item in the cache.

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

**Parameters:**

ParameterTypeDescription`key`**string**`value`**int****Return Value:**

---

### SimpleCachePool::add

[](#simplecachepooladd)

Adds data if it doesn't already exists

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

**Parameters:**

ParameterTypeDescription`key`**string**`value`**mixed|\\Closure****Return Value:**

True if the data have been added, false otherwise

---

### SimpleCachePool::clear

[](#simplecachepoolclear)

{@inheritdoc}

```
SimpleCachePool::clear(  ): bool
```

**Return Value:**

---

### SimpleCachePool::delete

[](#simplecachepooldelete)

{@inheritdoc}

```
SimpleCachePool::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### SimpleCachePool::deleteMultiple

[](#simplecachepooldeletemultiple)

{@inheritdoc}

```
SimpleCachePool::deleteMultiple( iterable keys ): bool
```

**Parameters:**

ParameterTypeDescription`keys`**iterable****Return Value:**

---

### SimpleCachePool::get

[](#simplecachepoolget)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**string**`default`**mixed****Return Value:**

---

### SimpleCachePool::getMultiple

[](#simplecachepoolgetmultiple)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`keys`**iterable**`default`**mixed****Return Value:**

---

### SimpleCachePool::has

[](#simplecachepoolhas)

{@inheritdoc}

```
SimpleCachePool::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### SimpleCachePool::set

[](#simplecachepoolset)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`key`**string**`value`**mixed**`ttl`**null|int|\\DateInterval****Return Value:**

---

### SimpleCachePool::setMultiple

[](#simplecachepoolsetmultiple)

{@inheritdoc}

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

**Parameters:**

ParameterTypeDescription`values`**iterable**`ttl`**null|int|\\DateInterval****Return Value:**

---

### SimpleCachePool::\_\_debugInfo

[](#simplecachepool__debuginfo)

```
SimpleCachePool::__debugInfo(  ): array
```

**Return Value:**

---

SQLite3Adapter
--------------

[](#sqlite3adapter)

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

### SQLite3Adapter::\_\_construct

[](#sqlite3adapter__construct)

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

**Parameters:**

ParameterTypeDescription`driver`**\\SQLite3**`table`**string****Return Value:**

---

### SQLite3Adapter::read

[](#sqlite3adapterread)

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

**Parameters:**

ParameterTypeDescription`key`**string**`data`**bool****Return Value:**

---

### SQLite3Adapter::query

[](#sqlite3adapterquery)

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

**Parameters:**

ParameterTypeDescription`query`**string****Return Value:**

---

Sqlite3Driver
-------------

[](#sqlite3driver)

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

### Sqlite3Driver::\_\_construct

[](#sqlite3driver__construct)

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

**Parameters:**

ParameterTypeDescription`driver`**\\SQLite3|\\PDO|string**A SQLite3 instance or a filename`table`**string****Return Value:**

---

### Sqlite3Driver::purge

[](#sqlite3driverpurge)

Removes expired item entries if supported

```
Sqlite3Driver::purge(  ): void
```

**Return Value:**

---

### Sqlite3Driver::clear

[](#sqlite3driverclear)

```
Sqlite3Driver::clear(  ): bool
```

**Return Value:**

---

### Sqlite3Driver::delete

[](#sqlite3driverdelete)

```
Sqlite3Driver::delete( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### Sqlite3Driver::getCacheEntry

[](#sqlite3drivergetcacheentry)

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

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### Sqlite3Driver::has

[](#sqlite3driverhas)

```
Sqlite3Driver::has( string key ): bool
```

**Parameters:**

ParameterTypeDescription`key`**string****Return Value:**

---

### Sqlite3Driver::\_\_debugInfo

[](#sqlite3driver__debuginfo)

```
Sqlite3Driver::__debugInfo(  ): array
```

**Return Value:**

---

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance40

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~238 days

Recently: every ~163 days

Total

7

Last Release

512d ago

Major Versions

1.0 → 2.0.0.beta12023-03-02

PHP version history (2 changes)1.0PHP &gt;=7.4

2.0.0.beta1PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a8b5abed81ea03ce4b93ef015ef273be7fab3ebca2050119c186f59e383c7b3?d=identicon)[ngsoft](/maintainers/ngsoft)

---

Top Contributors

[![ngsoft](https://avatars.githubusercontent.com/u/6670769?v=4)](https://github.com/ngsoft "ngsoft (400 commits)")

---

Tags

laravelpromisedoctrinecachecachingpsr-16psr-6apcuilluminatereactChainOpcachephpfilecache

### Embed Badge

![Health badge](/badges/ngsoft-cache/health.svg)

```
[![Health](https://phpackages.com/badges/ngsoft-cache/health.svg)](https://phpackages.com/packages/ngsoft-cache)
```

###  Alternatives

[phpfastcache/phpfastcache

PHP Abstract Cache Class - Reduce your database call using cache system. Phpfastcache handles a lot of drivers such as Apc(u), Cassandra, CouchBase, Couchdb, Dynamodb, Firestore, Mongodb, Files, (P)redis, Leveldb, Memcache(d), Ravendb, Ssdb, Sqlite, Wincache, Xcache, Zend Data Cache.

2.4k5.0M130](/packages/phpfastcache-phpfastcache)[matthiasmullie/scrapbook

Scrapbook is a PHP cache library, with adapters for e.g. Memcached, Redis, Couchbase, APCu, SQL and additional capabilities (e.g. transactions, stampede protection) built on top.

3212.5M32](/packages/matthiasmullie-scrapbook)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[apix/cache

A thin PSR-6 cache wrapper with a generic interface to various caching backends emphasising cache taggging and indexing to Redis, Memcached, PDO/SQL, APC and other adapters.

114542.8k6](/packages/apix-cache)[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1076.9M130](/packages/laminas-laminas-cache)[desarrolla2/cache

Provides an cache interface for several adapters Apc, Apcu, File, Mongo, Memcache, Memcached, Mysql, Mongo, Redis is supported.

1322.5M47](/packages/desarrolla2-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
