mirror of
https://github.com/cytopia/devilbox.git
synced 2025-02-20 17:33:05 +00:00
avoid PHP Fatal Error when mongo PHP modules are not available
This commit is contained in:
parent
6807b83e6b
commit
6c18e8f112
@ -230,4 +230,14 @@ class Mongo extends BaseClass implements BaseInterface
|
||||
}
|
||||
return $this->_version;
|
||||
}
|
||||
|
||||
public function isAvailable()
|
||||
{
|
||||
if (extension_loaded('mongo') || extension_loaded('mongodb')) {
|
||||
return parent::isAvailable();
|
||||
}
|
||||
|
||||
// when php modules 'mongo' or 'mongodb' not available or just disable by configuration (see .env PHP_MODULES_DISABLE)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user