Skip to content

[V5˖] Configuring a fallback driver

Georges.L edited this page Mar 3, 2017 · 3 revisions

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'
]);

❗ At the moment the fallback does not support the override of options. Therefore you cannot put Ssdb as a fallback of Redis due to the conflict of the following options:

  • port
  • host
  • password

But Files will work.

‼️ When the fallback is configured and is triggered an E_USER_WARNING error will be raised to alert you that your project is running in degraded mode.

Clone this wiki locally