Skip to content

Commit 58f77cf

Browse files
committed
Added additional check in cache manager for extensions
1 parent c877fac commit 58f77cf

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
## 9.2.1
2+
##### 07 january 2024
3+
- __Misc__
4+
- Added additional check in cache manager for extensions
5+
16
## 9.2.0
2-
##### 10 january 2024
7+
##### 07 january 2024
38
- __API__
49
- Upgraded Phpfastcache API to `4.3.0` ([see changes](CHANGELOG_API.md))
510
- __Extensions__ (💡 New in 9.2)

lib/Phpfastcache/CacheManager.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,19 @@ public static function getInstance(string $driver, ?ConfigurationOptionInterface
119119
ExtensionManager::loadExtension($driver);
120120
return CacheManager::getInstance($driver, $config, $instanceId);
121121
} catch (PhpfastcacheExtensionNotFoundException) {
122+
// Temporary check until v10
123+
$extensionWarning = '';
124+
if (in_array($driver, ['Arangodb', 'Couchdb', 'Dynamodb', 'Firestore', 'Mongodb', 'Solr'], true)) {
125+
$extensionWarning .= sprintf(
126+
'However, it seems that you are using a driver which is now an extension. Run the following command to solve this issue: %s',
127+
sprintf('composer install phpfastcache/%s-extension', strtolower($driver))
128+
);
129+
}
122130
throw new PhpfastcacheDriverNotFoundException(sprintf(
123-
'The driver "%s" does not exist or does not implement %s',
131+
'The driver "%s" does not exist or does not implement %s. %s',
124132
$driver,
125-
ExtendedCacheItemPoolInterface::class
133+
ExtendedCacheItemPoolInterface::class,
134+
$extensionWarning,
126135
));
127136
}
128137
}

0 commit comments

Comments
 (0)