-
-
Notifications
You must be signed in to change notification settings - Fork 452
[V5˖] Configuring a fallback driver
In some case you want to be sure that a fallback cache is available if the main one fails for some reasons. The code is pretty simple:
$InstanceCache = CacheManager::getInstance('redis', [
'fallback' => 'Files',
'path' => 'path/to/write/files/to'
]);
❗ Until the V7 the fallback does not support the override of configuration.
Therefore you cannot put Ssdb
as a fallback of Redis
due to the conflict of the following options:
- port
- host
- password
As of the V7 this will ensure you a completely independant fallback configuration:
$InstanceCache = CacheManager::getInstance('redis', new ConfigurationOption([
'fallback' => 'Files',
'fallback_config' => new ConfigurationOption(/* ... */),
'path' => 'path/to/write/files/to'
]));
But Files
will work (please note that as of the V6.1 the path
configuration can be conflicting).
❓ Finally, if you need help, always check out the inevitable README.md