credentials; } public function is_multi_db() { return $this->multi_db; } public function get_name() { return $this->name; } public function ping() { if (false === $this->is_connected()) { return false; } try { $this->connection->query('SELECT 1'); } catch (\PDOException $e) { return false; } return true; } public function server_info() { if (false === $this->ping()) { throw new \Exception('Mysql server is not reachable'); } return $this->connection->getAttribute(constant("PDO::ATTR_SERVER_VERSION")); } public function __destruct() { $this->close(); } protected function is_connected() { return $this->connection !== null; } }