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.
Requires
- php: >=8.1
- ngsoft/container: ^1.0
- ngsoft/filesystem: ^1.0
- psr/cache: ^3
- psr/event-dispatcher: ^1
- psr/log: ^1|^2|^3
- psr/simple-cache: ^3
- symfony/var-exporter: ^6.4
Requires (Dev)
- doctrine/cache: >=1.10.1,<2.0
- illuminate/cache: >=9.0
- onspli/phpdoc-markdown: ^0.3.3
- react/cache: >=1.1
- symfony/cache: >=6.0
Suggests
- ext-Zend-OPcache: Can Accelerate php file caching see: https://www.php.net/manual/en/opcache.installation.php
- doctrine/cache: A popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.
- illuminate/cache: The Illuminate Cache package.
- react/cache: Async, Promise-based cache interface.
Provides
Conflicts
- doctrine/cache: <1.10.1
- illuminate/cache: <9.0.0
- ngsoft/tools: <4
- react/cache: <1.1
- symfony/cache: <6.0
This package is auto-updated.
Last update: 2024-11-24 00:27:23 UTC
README
Table of Contents
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:
Return Value:
ApcuDriver::getCacheEntry
ApcuDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
ApcuDriver::has
ApcuDriver::has( string key ): bool
Parameters:
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:
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:
Return Value:
ArrayDriver::getCacheEntry
{@inheritdoc}
ArrayDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
ArrayDriver::has
{@inheritdoc}
ArrayDriver::has( string key ): bool
Parameters:
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:
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:
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:
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:
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:
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:
Return Value:
Cache::deleteItems
{@inheritdoc}
Cache::deleteItems( array keys ): bool
- This method is static. Parameters:
Return Value:
Cache::getItem
{@inheritdoc}
Cache::getItem( string key ): \NGSOFT\Cache\Interfaces\TaggableCacheItem
- This method is static. Parameters:
Return Value:
Cache::getItems
{@inheritdoc}
Cache::getItems( array keys = [] ): iterable
- This method is static. Parameters:
Return Value:
Cache::hasItem
{@inheritdoc}
Cache::hasItem( string key ): bool
- This method is static. Parameters:
Return Value:
Cache::save
{@inheritdoc}
Cache::save( \Psr\Cache\CacheItemInterface item ): bool
- This method is static. Parameters:
Return Value:
Cache::saveDeferred
{@inheritdoc}
Cache::saveDeferred( \Psr\Cache\CacheItemInterface item ): bool
- This method is static. Parameters:
Return Value:
Cache::lock
{@inheritdoc}
Cache::lock( string name, int|float seconds, string owner = '' ): \NGSOFT\Lock\LockStore
- This method is static. Parameters:
Return Value:
Cache::setPrefix
Change cache prefix
Cache::setPrefix( string prefix ): void
- This method is static. Parameters:
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:
Return Value:
CacheEntry::getCacheItem
CacheEntry::getCacheItem( string key ): \NGSOFT\Cache\CacheItem
Parameters:
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:
Return Value:
CacheEntry::createEmpty
CacheEntry::createEmpty( string key ): static
- This method is static. Parameters:
Return Value:
CacheEntry::__serialize
CacheEntry::__serialize( ): array
Return Value:
CacheEntry::__unserialize
CacheEntry::__unserialize( array data ): void
Parameters:
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:
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:
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:
Return Value:
CacheItem::create
CacheItem::create( string key, ?array metadata = null ): static
- This method is static. Parameters:
Return Value:
CacheItem::__construct
CacheItem::__construct( string key, ?array metadata = null ): mixed
Parameters:
Return Value:
CacheItem::tag
Adds a tag to a cache item.
CacheItem::tag( string|iterable tags ): static
Parameters:
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:
Return Value:
CacheItem::expiresAt
{@inheritdoc}
CacheItem::expiresAt( ?\DateTimeInterface expiration ): static
Parameters:
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:
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:
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:
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:
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:
Return Value:
CachePool::increment
Increment the value of an item in the cache.
CachePool::increment( string key, int value = 1 ): int
Parameters:
Return Value:
CachePool::decrement
Decrement the value of an item in the cache.
CachePool::decrement( string key, int value = 1 ): int
Parameters:
Return Value:
CachePool::add
Adds data if it doesn't already exists
CachePool::add( string key, mixed|\Closure value ): bool
Parameters:
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:
Return Value:
CachePool::deleteItems
{@inheritdoc}
CachePool::deleteItems( array keys ): bool
Parameters:
Return Value:
CachePool::getItem
{@inheritdoc}
CachePool::getItem( string key ): \NGSOFT\Cache\Interfaces\TaggableCacheItem
Parameters:
Return Value:
CachePool::getItems
{@inheritdoc}
CachePool::getItems( array keys = [] ): iterable
Parameters:
Return Value:
CachePool::hasItem
{@inheritdoc}
CachePool::hasItem( string key ): bool
Parameters:
Return Value:
CachePool::save
{@inheritdoc}
CachePool::save( \Psr\Cache\CacheItemInterface item ): bool
Parameters:
Return Value:
CachePool::saveDeferred
{@inheritdoc}
CachePool::saveDeferred( \Psr\Cache\CacheItemInterface item ): bool
Parameters:
Return Value:
CachePool::lock
{@inheritdoc}
CachePool::lock( string name, int|float seconds, string owner = '' ): \NGSOFT\Lock\LockStore
Parameters:
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:
Return Value:
ChainDriver::setDefaultLifetime
set the default ttl
ChainDriver::setDefaultLifetime( int defaultLifetime ): void
Parameters:
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:
Return Value:
ChainDriver::set
Persists data in the cache
ChainDriver::set( string key, mixed value, ?int ttl = null, string|array tags = [] ): bool
Parameters:
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:
Return Value:
ChainDriver::getCacheEntry
ChainDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
ChainDriver::has
ChainDriver::has( string key ): bool
Parameters:
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:
Return Value:
DoctrineCacheProvider::getNamespace
DoctrineCacheProvider::getNamespace( ): string
Return Value:
DoctrineCacheProvider::setNamespace
DoctrineCacheProvider::setNamespace( mixed namespace ): void
Parameters:
Return Value:
DoctrineCacheProvider::setLogger
{@inheritdoc}
DoctrineCacheProvider::setLogger( \Psr\Log\LoggerInterface logger ): void
Parameters:
Return Value:
DoctrineCacheProvider::contains
{@inheritdoc}
DoctrineCacheProvider::contains( mixed id ): bool
Parameters:
Return Value:
DoctrineCacheProvider::delete
{@inheritdoc}
DoctrineCacheProvider::delete( mixed id ): bool
Parameters:
Return Value:
DoctrineCacheProvider::fetch
{@inheritdoc}
DoctrineCacheProvider::fetch( mixed id ): mixed
Parameters:
Return Value:
DoctrineCacheProvider::save
{@inheritdoc}
DoctrineCacheProvider::save( mixed id, mixed data, mixed lifeTime ): bool
Parameters:
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:
Return Value:
DoctrineCacheProvider::fetchMultiple
{@inheritdoc}
DoctrineCacheProvider::fetchMultiple( array keys ): array
Parameters:
Return Value:
DoctrineCacheProvider::saveMultiple
{@inheritdoc}
DoctrineCacheProvider::saveMultiple( array keysAndValues, mixed lifetime ): bool
Parameters:
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:
Return Value:
DoctrineDriver::clear
DoctrineDriver::clear( ): bool
Return Value:
DoctrineDriver::delete
DoctrineDriver::delete( string key ): bool
Parameters:
Return Value:
DoctrineDriver::getCacheEntry
DoctrineDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
DoctrineDriver::has
DoctrineDriver::has( string key ): bool
Parameters:
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:
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:
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:
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:
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:
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:
Return Value:
FileCache::deleteItems
{@inheritdoc}
FileCache::deleteItems( array keys ): bool
- This method is static. Parameters:
Return Value:
FileCache::getItem
{@inheritdoc}
FileCache::getItem( string key ): \NGSOFT\Cache\Interfaces\TaggableCacheItem
- This method is static. Parameters:
Return Value:
FileCache::getItems
{@inheritdoc}
FileCache::getItems( array keys = [] ): iterable
- This method is static. Parameters:
Return Value:
FileCache::hasItem
{@inheritdoc}
FileCache::hasItem( string key ): bool
- This method is static. Parameters:
Return Value:
FileCache::save
{@inheritdoc}
FileCache::save( \Psr\Cache\CacheItemInterface item ): bool
- This method is static. Parameters:
Return Value:
FileCache::saveDeferred
{@inheritdoc}
FileCache::saveDeferred( \Psr\Cache\CacheItemInterface item ): bool
- This method is static. Parameters:
Return Value:
FileCache::lock
{@inheritdoc}
FileCache::lock( string name, int|float seconds, string owner = '' ): \NGSOFT\Lock\LockStore
- This method is static. Parameters:
Return Value:
FileCache::setPrefix
Change cache prefix
FileCache::setPrefix( string prefix ): void
- This method is static. Parameters:
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:
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:
Return Value:
FileDriver::getCacheEntry
FileDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
FileDriver::has
FileDriver::has( string key ): bool
Parameters:
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:
Return Value:
IlluminateDriver::clear
IlluminateDriver::clear( ): bool
Return Value:
IlluminateDriver::delete
IlluminateDriver::delete( string key ): bool
Parameters:
Return Value:
IlluminateDriver::getCacheEntry
IlluminateDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
IlluminateDriver::has
IlluminateDriver::has( string key ): bool
Parameters:
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:
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:
Return Value:
JsonDriver::getCacheEntry
JsonDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
JsonDriver::has
JsonDriver::has( string key ): bool
Parameters:
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:
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:
Return Value:
LaravelStore::setLogger
{@inheritdoc}
LaravelStore::setLogger( \Psr\Log\LoggerInterface logger ): void
Parameters:
Return Value:
LaravelStore::increment
{@inheritdoc}
LaravelStore::increment( mixed key, mixed value = 1 ): int
Parameters:
Return Value:
LaravelStore::decrement
{@inheritdoc}
LaravelStore::decrement( mixed key, mixed value = 1 ): int
Parameters:
Return Value:
LaravelStore::flush
{@inheritdoc}
LaravelStore::flush( ): bool
Return Value:
LaravelStore::forever
{@inheritdoc}
LaravelStore::forever( mixed key, mixed value ): bool
Parameters:
Return Value:
LaravelStore::forget
{@inheritdoc}
LaravelStore::forget( mixed key ): bool
Parameters:
Return Value:
LaravelStore::get
{@inheritdoc}
LaravelStore::get( mixed key ): mixed
Parameters:
Return Value:
LaravelStore::getPrefix
{@inheritdoc}
LaravelStore::getPrefix( ): string
Return Value:
LaravelStore::many
{@inheritdoc}
LaravelStore::many( array keys ): array
Parameters:
Return Value:
LaravelStore::put
{@inheritdoc}
LaravelStore::put( mixed key, mixed value, mixed seconds ): bool
Parameters:
Return Value:
LaravelStore::putMany
{@inheritdoc}
LaravelStore::putMany( array values, mixed seconds ): bool
Parameters:
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:
Return Value:
NullDriver::getCacheEntry
NullDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
NullDriver::has
NullDriver::has( string key ): bool
Parameters:
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:
Return Value:
PDOAdapter::read
PDOAdapter::read( string key, bool data = true ): array|false
Parameters:
Return Value:
PDOAdapter::query
PDOAdapter::query( string query ): array|bool
Parameters:
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:
Return Value:
PHPCache::appendDriver
Put a driver at the end of the chain
PHPCache::appendDriver( \NGSOFT\Cache\Interfaces\CacheDriver driver ): static
Parameters:
Return Value:
PHPCache::prependDriver
Put a driver at the beginning of the chain
PHPCache::prependDriver( \NGSOFT\Cache\Interfaces\CacheDriver driver ): static
Parameters:
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:
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:
Return Value:
PhpDriver::getCacheEntry
PhpDriver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
PhpDriver::has
PhpDriver::has( string key ): bool
Parameters:
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:
Return Value:
PSR16Driver::clear
PSR16Driver::clear( ): bool
Return Value:
PSR16Driver::delete
PSR16Driver::delete( string key ): bool
Parameters:
Return Value:
PSR16Driver::getCacheEntry
PSR16Driver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
PSR16Driver::has
PSR16Driver::has( string key ): bool
Parameters:
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:
Return Value:
PSR6Driver::getCacheEntry
PSR6Driver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
PSR6Driver::clear
PSR6Driver::clear( ): bool
Return Value:
PSR6Driver::delete
PSR6Driver::delete( string key ): bool
Parameters:
Return Value:
PSR6Driver::has
PSR6Driver::has( string key ): bool
Parameters:
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:
Return Value:
ReactCache::setLogger
{@inheritdoc}
ReactCache::setLogger( \Psr\Log\LoggerInterface logger ): void
Parameters:
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:
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:
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:
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:
Return Value:
ReactCache::has
{@inheritdoc}
ReactCache::has( mixed key ): \React\Promise\PromiseInterface
Parameters:
Return Value:
ReactCache::get
{@inheritdoc}
ReactCache::get( mixed key, mixed default = null ): \React\Promise\PromiseInterface
Parameters:
Return Value:
ReactCache::set
{@inheritdoc}
ReactCache::set( mixed key, mixed value, mixed ttl = null ): \React\Promise\PromiseInterface
Parameters:
Return Value:
ReactCache::deleteMultiple
{@inheritdoc}
ReactCache::deleteMultiple( array keys ): \React\Promise\PromiseInterface
Parameters:
Return Value:
ReactCache::getMultiple
{@inheritdoc}
ReactCache::getMultiple( array keys, mixed default = null ): \React\Promise\PromiseInterface
Parameters:
Return Value:
ReactCache::setMultiple
{@inheritdoc}
ReactCache::setMultiple( array values, mixed ttl = null ): \React\Promise\PromiseInterface
Parameters:
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:
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:
Return Value:
SimpleCachePool::decrement
Decrement the value of an item in the cache.
SimpleCachePool::decrement( string key, int value = 1 ): int
Parameters:
Return Value:
SimpleCachePool::add
Adds data if it doesn't already exists
SimpleCachePool::add( string key, mixed|\Closure value ): bool
Parameters:
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:
Return Value:
SimpleCachePool::deleteMultiple
{@inheritdoc}
SimpleCachePool::deleteMultiple( iterable keys ): bool
Parameters:
Return Value:
SimpleCachePool::get
{@inheritdoc}
SimpleCachePool::get( string key, mixed default = null ): mixed
Parameters:
Return Value:
SimpleCachePool::getMultiple
{@inheritdoc}
SimpleCachePool::getMultiple( iterable keys, mixed default = null ): iterable
Parameters:
Return Value:
SimpleCachePool::has
{@inheritdoc}
SimpleCachePool::has( string key ): bool
Parameters:
Return Value:
SimpleCachePool::set
{@inheritdoc}
SimpleCachePool::set( string key, mixed value, null|int|\DateInterval ttl = null ): bool
Parameters:
Return Value:
SimpleCachePool::setMultiple
{@inheritdoc}
SimpleCachePool::setMultiple( iterable values, null|int|\DateInterval ttl = null ): bool
Parameters:
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:
Return Value:
SQLite3Adapter::read
SQLite3Adapter::read( string key, bool data = true ): array|false
Parameters:
Return Value:
SQLite3Adapter::query
SQLite3Adapter::query( string query ): array|bool
Parameters:
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:
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:
Return Value:
Sqlite3Driver::getCacheEntry
Sqlite3Driver::getCacheEntry( string key ): \NGSOFT\Cache\CacheEntry
Parameters:
Return Value:
Sqlite3Driver::has
Sqlite3Driver::has( string key ): bool
Parameters:
Return Value:
Sqlite3Driver::__debugInfo
Sqlite3Driver::__debugInfo( ): array
Return Value: