-
-
Notifications
You must be signed in to change notification settings - Fork 453
[V8˖] Migrating your code to the V9
Because the V9 is relatively not backward compatible with the V8, here's a guide to help you to migrate your code:
As of the V9 the mandatory minimum php version has been increased to 8.0+. Once released, the php version 8.1 will be unit-tested
Use Composer to include Phpfastcache in your project
Use CacheManager::getInstance('DriverName')
instead.
This decision was made to make the cache manager more consistent by removing the "old legacy code".
You can no longer use the following array-compatible syntax: $config['yourKey'] = 'value'
Use the object-notation syntax instead: $config->setYourKey('value')
However, this syntax is STILL valid through the configuration constructor
For the default config object: new ConfigurationOption(['yourKey' => 'yourValue'])
Or for specific config objects: new \Phpfastcache\Drivers\Files\Config(['yourKey' => 'yourValue'])
Finally, the config name you try to set MUST be recognized or an exception will be thrown.
Use \Phpfastcache\CacheContract
instead. See Wiki.
It is now replaced by Couchbasev3
driver (SDK 3), the configuration options are all the same plus scopeName
and collectionName
that are now configurable.
- 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)
See EVENTS.md file for more information
- The Phpfastcache API has been upgraded to
4.0.0
with BC breaks. See full changes - Renamed
Api::getPhpFastCacheVersion()
toApi::getPhpfastcacheVersion()
- Renamed
Api::getPhpFastCacheChangelog()
toApi::getPhpfastcacheChangelog()
- Renamed
Api::getPhpFastCacheGitHeadHash()
toApi::getPhpfastcacheGitHeadHash()
They have not been replaced.
However, the Devrandom
driver with configurable factor chance and data length has been added
- We consider that it's no longer the task of Phpfastcache to handle server configuration
- Removed
IOConfigurationOptionTrait::getHtaccess()
- Removed
IOConfigurationOptionTrait::setHtaccess()
If you try to set a configuration value after the cache pool instance is being built, an exception will be thrown.
However, you can always implement it by yourself if you want to by putting it back from previous versions using \Phpfastcache\CacheManager::addCustomDriver()
method
More information in our comprehensive changelog.
❓ Finally, if you need help, always check out the inevitable README.md