mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-30 08:03:50 +00:00
Merge pull request #802 from llaville/patch-intranet
Patch intranet to fix issue 801
This commit is contained in:
commit
d8e728a6a4
@ -19,7 +19,7 @@
|
||||
<div class="col-md-12">
|
||||
|
||||
<?php if (!loadClass('Memcd')->isAvailable()): ?>
|
||||
<p>Memcahed container is not running.</p>
|
||||
<p>Memcached container is not running.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach (loadClass('Memcd')->getInfo() as $srv => $data): ?>
|
||||
<h2><?php echo $srv; ?></h2>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user