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