avoid PHP Fatal Error when redis PHP module is not available

This commit is contained in:
Laurent Laville 2021-04-19 17:21:47 +02:00
parent 6c18e8f112
commit 46f5c48ba0

View File

@ -218,4 +218,14 @@ class Redis extends BaseClass implements BaseInterface
return $this->_version; return $this->_version;
} }
public function isAvailable()
{
if (extension_loaded('redis')) {
return parent::isAvailable();
}
// when php module 'redis' not available or just disable by configuration (see .env PHP_MODULES_DISABLE)
return false;
}
} }