diff --git a/.devilbox/www/htdocs/info_memcd.php b/.devilbox/www/htdocs/info_memcd.php index d23f8cf2..9adce79d 100644 --- a/.devilbox/www/htdocs/info_memcd.php +++ b/.devilbox/www/htdocs/info_memcd.php @@ -19,7 +19,7 @@
isAvailable()): ?> -

Memcahed container is not running.

+

Memcached container is not running.

getInfo() as $srv => $data): ?>

diff --git a/.devilbox/www/include/lib/container/Memcd.php b/.devilbox/www/include/lib/container/Memcd.php index 2a6906f8..91c302fa 100644 --- a/.devilbox/www/include/lib/container/Memcd.php +++ b/.devilbox/www/include/lib/container/Memcd.php @@ -37,6 +37,11 @@ class Memcd extends BaseClass implements BaseInterface { parent::__construct($hostname, $data); + // Faster check if memcached is not loaded + if (!$this->isAvailable()) { + return; + } + if (class_exists('Memcached')) { $memcd = new \Memcached('_devilbox'); $list = $memcd->getServerList(); @@ -274,4 +279,14 @@ class Memcd extends BaseClass implements BaseInterface } return $this->_version; } + + public function isAvailable() + { + if (extension_loaded('memcached')) { + return parent::isAvailable(); + } + + // when php module 'memcached' not available or just disable by configuration (see .env PHP_MODULES_DISABLE) + return false; + } } diff --git a/.devilbox/www/include/lib/container/Mongo.php b/.devilbox/www/include/lib/container/Mongo.php index 0b941d29..30450e8e 100644 --- a/.devilbox/www/include/lib/container/Mongo.php +++ b/.devilbox/www/include/lib/container/Mongo.php @@ -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; + } } diff --git a/.devilbox/www/include/lib/container/Mysql.php b/.devilbox/www/include/lib/container/Mysql.php index 031c8050..417d812a 100644 --- a/.devilbox/www/include/lib/container/Mysql.php +++ b/.devilbox/www/include/lib/container/Mysql.php @@ -31,6 +31,11 @@ class Mysql extends BaseClass implements BaseInterface { parent::__construct($hostname, $data); + // Faster check if mysql is not loaded + if (!$this->isAvailable()) { + return; + } + $user = $data['user']; $pass = $data['pass']; @@ -308,4 +313,14 @@ class Mysql extends BaseClass implements BaseInterface return $this->_version; } + + public function isAvailable() + { + if (extension_loaded('mysqli')) { + return parent::isAvailable(); + } + + // when php module 'mysqli' not available or just disable by configuration (see .env PHP_MODULES_DISABLE) + return false; + } } diff --git a/.devilbox/www/include/lib/container/Pgsql.php b/.devilbox/www/include/lib/container/Pgsql.php index 14832ed3..713aab44 100644 --- a/.devilbox/www/include/lib/container/Pgsql.php +++ b/.devilbox/www/include/lib/container/Pgsql.php @@ -38,6 +38,11 @@ class Pgsql extends BaseClass implements BaseInterface { parent::__construct($hostname, $data); + // Faster check if pgsql is not loaded + if (!$this->isAvailable()) { + return; + } + $user = $data['user']; $pass = $data['pass']; $db = isset($data['db']) ? $data['db'] : null; @@ -372,4 +377,14 @@ class Pgsql extends BaseClass implements BaseInterface return $this->_version; } + + public function isAvailable() + { + if (extension_loaded('pgsql')) { + return parent::isAvailable(); + } + + // when php module 'pgsql' not available or just disable by configuration (see .env PHP_MODULES_DISABLE) + return false; + } } diff --git a/.devilbox/www/include/lib/container/Redis.php b/.devilbox/www/include/lib/container/Redis.php index 0a0f1bf5..235082f4 100644 --- a/.devilbox/www/include/lib/container/Redis.php +++ b/.devilbox/www/include/lib/container/Redis.php @@ -218,4 +218,14 @@ class Redis extends BaseClass implements BaseInterface 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; + } }