check for php extentions before calling the cache driver. this avoids unnecessarry errors

This commit is contained in:
HB9HIL
2026-02-02 14:11:51 +01:00
parent 2af5180aa7
commit 3ed51b53e6

View File

@@ -243,6 +243,12 @@ class Debug_model extends CI_Model
$available_adapters = ['file', 'redis', 'memcached', 'apcu'];
foreach ($available_adapters as $adapter) {
// For redis, memcached and apcu we should check for the extension first to avoid unnecessary errors
if (in_array($adapter, ['redis', 'memcached', 'apcu'])) {
$is_supported = extension_loaded($adapter) ?? false;
$response['adapters'][$adapter] = $is_supported;
continue;
}
$response['adapters'][$adapter] = $this->cache->is_supported($adapter);
}