/** * Pings a database connection and tries to reconnect it if it is broken. * @return bool */ public function ping() { try { $this->connected || $this->connect(); return $this->driver->ping(); } catch (DriverException $e) { return FALSE; } }