REL-0.9 Error checking in case some containers are not running

This commit is contained in:
cytopia 2017-05-08 09:22:10 +02:00
parent 07145d40ba
commit d9a255ae6a
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
2 changed files with 20 additions and 8 deletions

View File

@ -188,7 +188,10 @@ class Memcd extends _Base implements _iBase
public function getInfo()
{
$stats = $this->_memcached->getStats();
$stats = array();
if ($this->_memcached) {
$stats = $this->_memcached->getStats();
}
return $stats;
}
@ -207,12 +210,17 @@ class Memcd extends _Base implements _iBase
public function getVersion()
{
$info = $this->_memcached->getVersion();
$info = array_values($info);
if (!isset($info[0])) {
loadClass('Logger')->error('Could not get Memcached version');
return '';
$version = '';
if ($this->_memcached) {
$info = $this->_memcached->getVersion();
$info = array_values($info);
if (!isset($info[0])) {
loadClass('Logger')->error('Could not get Memcached version');
} else {
$version = $info[0];
}
}
return $info[0];
return $version;
}
}

View File

@ -252,7 +252,11 @@ class Mysql extends _Base implements _iBase
$data[$key] = $val;
};
return $this->select('SHOW VARIABLES;', $callback);
$config = $this->select('SHOW VARIABLES;', $callback);
if (!$config) {
$config = array();
}
return $config;
} else { // Get single config