- Migration guide
- Read the migration guide to upgrade from V8 to V9
- PSR-6
- Upgraded
psr/cache
dependency 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
- To be written when the PSR-16 will be upgraded for PHP-8
- API
- Upgraded Phpfastcache API
4.0.0
(see changes) - Renamed
Api::getPhpFastCacheVersion()
toApi::getPhpfastcacheVersion()
- Renamed
Api::getPhpFastCacheChangelog()
toApi::getPhpfastcacheChangelog()
- Renamed
Api::getPhpFastCacheGitHeadHash()
toApi::getPhpfastcacheGitHeadHash()
- Upgraded Phpfastcache API
- Cluster
- Renamed
\Phpfastcache\Cluster\AggregatorInterface::aggregateNewDriver()
to\Phpfastcache\Cluster\AggregatorInterface::aggregateDriverByName()
- Renamed
- Exceptions
- Added
PhpfastcacheEventManagerException
for EventManager-related exceptions
- Added
- Global
- Removed magics methods from CacheManager
CacheManager::DriverName()
, useCacheManager::getInstance('DriverName')
instead \Phpfastcache\Proxy\PhpfastcacheAbstractProxy
now 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]\Item
classes) - 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\CacheContract
instead - The
\Phpfastcache\CacheContract
class 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
ConfigurationOption
which is no longer anArrayObject
class, therefore array-syntax is no longer available. - Removed configuration entry
htaccess
for 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::set
will not accept\Closure
object anymore as method unique parameter
- Drivers
- Added
Arangodb
driver support - Added
Dynamodb
(AWS) driver support - Added
Firestore
(GCP) driver support - Removed
Cookie
driver because of its potential dangerosity - Removed
Couchbase
(SDK 2 support dropped) driver which is now replaced byCouchbasev3
(SDK 3) - Removed
Devtrue
andDevfalse
drivers - Added
Devrandom
with configurable factor chance and data length - Renamed classes
\Phpfastcache\Cluster\Drivers\[STATEGY]\[CLUSTER_NAME]Cluster
to\Phpfastcache\Cluster\Drivers\[STATEGY]\Driver
for better driver naming across the project
- Added
- Events
- Added
\Phpfastcache\Event\EventReferenceParameter
class and more events such as driver-specific events, see EVENTS.md file for more information - Event callbacks will now receive the
eventName
as an extra last callback parameter (except foronEveryEvents
callbacks) - Added
EventManagerInterface::on(array $eventNames, $callback)
method, to subscribe to multiple events in once with the same callback - Added method named
unbindAllEventCallbacks(): bool
toEventManagerInterface
to 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 frommixed
toEventReferenceParameter(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
PhpFastCache
toPhpcastcache
- Increased minimum PHP compatibility in composer to