- Core
- PHP 8.4 compatibility (@khoaofgod, @CHANCENY)
- Drivers
- Redis: Refactor Redis driver to read all keys efficiently (@mapcentia)
- Drivers
- Added support of
Ravendbas an extension with its own sub-repository. - Deprecated
\Phpfastcache\Entities\DriverStatistic::getData(). Will be removed as of v10. - Deprecated
\Phpfastcache\Entities\DriverStatistic::setData(). Will be removed as of v10. - Added
\Phpfastcache\Entities\DriverStatistic::getCount(): int|null. If applicable will return the count of cache objects stored in driver database/collection. Null otherwise. - Added
\Phpfastcache\Entities\DriverStatistic::setCount()
- Added support of
- Core
- Added optional prefix to
\Phpfastcache\Core\Pool\CacheItemPoolTrait::getKeys()
- Added optional prefix to
- Misc
- Added additional check in cache manager for extensions
- API
- Upgraded Phpfastcache API to
4.3.0(see changes)
- Upgraded Phpfastcache API to
- Extensions (💡 New in 9.2)
- Created an extension mechanism to allow some drivers to be loaded independently, see README.md
- Added support of
Couchbasev4as an extension with its own sub-repository. - IMPORTANT: AS OF v9.2 the following drivers has been MOVED to their own sub-repositories as a standalone extension:
Arangodb,Couchdb,Dynamodb,Firestore,Mongodb,Solr. HoweverCouchbasev3will stay in the core for compatibility reasons but will be deprecated. - IMPORTANT: AS OF v10 extensions will have their namespaces permanently moved from
Phpfastcache\Drivers\EXT_NAME\{Config, Driver, Event, Item}toPhpfastcache\Extensions\Drivers\EXT_NAME\{Config, Driver, Event, Item}. For now an alias is ensuring compatibility.
- Events
- EventManager is now scoped to its own poll if retrieved through
ExtendedCacheItemPoolTrait::->getEventManager(). Global EventManagerEventManager::getInstance()remains unchanged, see EVENTS.md. EventManagerInterface::on()now also accepts a singlestring $events.- Alias
\Phpfastcache\PhpfastcacheEventManagerof\Phpfastcache\EventManagerhas been added to improve your code import readability. - Deprecated
\Phpfastcache\Event\EventManagerDispatcherInterface::hasEventManagerto be removed for v10.
- EventManager is now scoped to its own poll if retrieved through
- Drivers
- Implemented #906 // Added
RedisClusterdriver support - Driver
Memstatichas changed its name toMemoryfor more consistency. - Driver
Wincacheis now deprecated and will be removed as of v10 due to the lack of updates to PHP 8 as officially stated by PHP.
- Implemented #906 // Added
- Pool
- Added
ExtendedCacheItemPoolTrait::getAllItemsto allow you to retrieve all items in the cache. This method have some limitations, (see more in the Wiki).
- Added
- Core
- Configuration methods
ConfigurationOption::isPreventCacheSlams(),ConfigurationOption::setPreventCacheSlams(),ConfigurationOption::getCacheSlamsTimeout(),ConfigurationOption::setCacheSlamsTimeout()are deprecated. (See changes). - Fixed #907 // Internal "driver decode()" method will now throw an if the string data looks corrupted.
- Internal: Implemented multiple keys fetch (if supported by the backend) to improve the performances behind all
getItems()calls. Currently only supported in some backends, but it may evolve in the future. - Internal: Implemented multiple keys delete (if supported by the backend) to improve the performances behind all
deleteItems()calls. Currently only supported in some backends, but it may evolve in the future. \Phpfastcache\CacheContract::get()now accepts a\Stringable $cacheKeyargument.
- Configuration methods
- Tags
- Added
\Phpfastcache\Core\Item\TaggableCacheItemInterface::isTagged(): bool
- Added
- Misc
- Fixed multiple code typo & updated README.md
- Core
- Fixed #893 // getItemsByTag() - empty after one item has expired
- Misc
- Fixed multiple code typo & updated README.md
- API
- Upgraded Phpfastcache API to
4.2.0(see changes)
- Upgraded Phpfastcache API to
- Core
- Rewrote some core code to improve code maintainability & readability following Scrutinizer and Phpstan recommendations
- Fixed an issue with tags not properly reinitialized when a backend driver returns an expired cache item
- Drivers
- Fixed #866 // Deprecated Method Cassandra\ExecutionOptions starting of Cassandra 1.3
- Misc
- Increased PHPSTAN level to 6
- Fixed multiple fails of Travis CI
- Migrated Github issue templates from Markdown to YAML configurations
- Core
- Fixed #860 // Cache item throw an error on reading with DateTimeImmutable date objects
- Fixed an issue with tags not properly reinitialized when a backend driver returns an expired cache item
- Drivers
- Fixed #862 // Multiple driver errors caused by invalid return type of
driverRead()(reported by @ShockedPlot7560 and @aemla)
- Fixed #862 // Multiple driver errors caused by invalid return type of
- API
- Upgraded Phpfastcache API to
4.1.0(see changes)
- Upgraded Phpfastcache API to
- Core
- Added
\Phpfastcache\Helper\UninstanciableObjectTraittrait which will contains base locked constructor for any classes that are nor meant to be instanciated. - Deprecated
\Phpfastcache\Config\Config::class - Removed/reworked/improved dead/unreachable/redundant/obsolete code, thanks to
Phpstan
- Added
- Drivers
- Added
Solrdriver support
- Added
- Events
- Added
\Phpfastcache\Event\EventInterfacefor\Phpfastcache\Event\Eventand subclasses below - Added
\Phpfastcache\Drivers\Arangodb\Eventfor Arangodb events - Added
\Phpfastcache\Drivers\Dynamodb\Eventfor Dynamodb events - Added
\Phpfastcache\Drivers\Solr\Eventfor Solr events - Moved the following constant from
\Phpfastcache\Event\Eventto their respective drivers:ARANGODB_CONNECTION,ARANGODB_COLLECTION_PARAMS,DYNAMODB_CREATE_TABLE
- Added
- Cluster
- Fixed #855 // ClusterReplication drivers are saving erroneous expiration date in low-level backends
- Misc
- Full PSR-12 compliance is now enforced by PHPCS
- Multiple typo fixes (@mbiebl)
- Updated composer suggestions and CI builder dependencies
- Core
- Updated CacheContract::__invoke() signature
- Added new option to allow EventManager override + improved EventManager tests (EventManager::setInstance())
- Drivers
- Fixed #853 // Configuration validation issue with Memcached socket (path)
- Misc
- Fixed typo and some types hint
- Core
- Added
\Phpfastcache\Event\Eventclass for centralizing event name with reusable constants.
- Added
- Item
\Psr\Cache\CacheItemInterface::setwill also no longer accepts resource object anymore as method unique parameter
- Misc
- Fixed typos in README.md
- Migration guide
- Read the migration guide to upgrade from V8 to V9
- PSR-6
- Upgraded
psr/cachedependency to^2.0||^3.0(for PHP-8 types) \Psr\Cache\CacheItemInterface::get()slightly changed to fully comply with missing PSR-6 specification: If the cache item is NOT hit, this method will returnNULL.
- Upgraded
- PSR-16
- Upgraded
psr/simple-cachedependency to^2.0||^3.0(for PHP-8 types)
- Upgraded
- API
- Upgraded Phpfastcache API to
4.0.0(see changes) - Renamed
Api::getPhpFastCacheVersion()toApi::getPhpfastcacheVersion() - Renamed
Api::getPhpFastCacheChangelog()toApi::getPhpfastcacheChangelog() - Renamed
Api::getPhpFastCacheGitHeadHash()toApi::getPhpfastcacheGitHeadHash()
- Upgraded Phpfastcache API to
- Cluster
- Renamed
\Phpfastcache\Cluster\AggregatorInterface::aggregateNewDriver()to\Phpfastcache\Cluster\AggregatorInterface::aggregateDriverByName()
- Renamed
- Exceptions
- Added
PhpfastcacheEventManagerExceptionfor EventManager-related exceptions
- Added
- Global
- Removed magics methods from CacheManager
CacheManager::DriverName(), useCacheManager::getInstance('DriverName')instead \Phpfastcache\Proxy\PhpfastcacheAbstractProxynow implements\Phpfastcache\Proxy\PhpfastcacheAbstractProxyInterface- Slightly increased performances on some critical points of the library
- Removed "BadPracticeOMeter" notice in CacheManager
- Removed many code duplicate (like in
\Phpfastcache\Driver\[DRIVER_NAME]\Itemclasses) - Reworked traits inter-dependencies for better logic and less polymorphic calls in pool/item traits
- Upgrading library to use benefits of PHP 8 new features (see below)
- Typed every class properties of the library
- Migrated many Closure to arrow functions
- Updated parameters & return type hint to use benefit of covariance and contravariance
- Removed embedded Autoload, Phpfastcache is now only Composer-compatible.
- Removed embedded dependencies (
psr/cache,psr/simple-cache)
- Removed magics methods from CacheManager
- Helpers
- Deprecated
\Phpfastcache\Helper\CacheConditionalHelper, use\Phpfastcache\CacheContractinstead - The
\Phpfastcache\CacheContractclass is now also callable directly without callingget()method
- Deprecated
- Config/Options
- Configuration object will now be locked once the cache pool instance is running.
- Updated
ConfigurationOptionwhich is no longer anArrayObjectclass, therefore array-syntax is no longer available. - Removed configuration entry
htaccessfor files-based drivers. - Removed
IOConfigurationOptionTrait::getHtaccess() - Removed
IOConfigurationOptionTrait::setHtaccess()
- Tests
- Added PHPMD, PHPCS and PHPSTAN coverages to increase quality of the project
- Updated tests to work with new core/drivers changes
- Removed Autoload test since its support has been removed and now only managed by Composer
- Increased tests reliability and code coverage for better catching any eventual regression
- Item
\Psr\Cache\CacheItemInterface::setwill not accept\Closureobject anymore as method unique parameter
- Drivers
- Added
Arangodbdriver support - Added
Dynamodb(AWS) driver support - Added
Firestore(GCP) driver support - Removed
Cookiedriver because of its potential dangerosity - Removed
Couchbase(SDK 2 support dropped) driver which is now replaced byCouchbasev3(SDK 3) - Removed
DevtrueandDevfalsedrivers - Added
Devrandomwith configurable factor chance and data length - Renamed classes
\Phpfastcache\Cluster\Drivers\[STATEGY]\[CLUSTER_NAME]Clusterto\Phpfastcache\Cluster\Drivers\[STATEGY]\Driverfor better driver naming across the project
- Added
- Events
- Added
\Phpfastcache\Event\EventReferenceParameterclass and more events such as driver-specific events, see EVENTS.md file for more information - Event callbacks will now receive the
eventNameas an extra last callback parameter (except foronEveryEventscallbacks) - Added
EventManagerInterface::on(array $eventNames, $callback)method, to subscribe to multiple events in once with the same callback - Added method named
unbindAllEventCallbacks(): booltoEventManagerInterfaceto allow you to unbind/clear all event from an event instance - Updated argument type #2 (
$items) ofonCacheSaveMultipleItems()event fromExtendedCacheItemInterface[]toEventReferenceParameter($items) - Updated argument type #2 (
$items) ofonCacheCommitItem()event fromExtendedCacheItemInterface[]toEventReferenceParameter($items) - Updated argument type #2 (
$value) ofonCacheItemSet()event frommixedtoEventReferenceParameter(mixed $value)
- Added
- Misc
- Increased minimum PHP compatibility in composer to
^8.0 - Updated copyright headers on every file to include the many project contributors
- Globally renamed every occurrence of
PhpFastCachetoPhpcastcache
- Increased minimum PHP compatibility in composer to