X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fdba.php;h=86a3762b44f041945891eca407e5e31269fd7b77;hb=b50769b6d09549e1641bab1813087fd928602129;hp=5e84b95df559a18a2878e09e4fa675bc99d85172;hpb=014fc5dccbf24a6473e0e2e9bdca810103d8b202;p=friendica.git diff --git a/include/dba.php b/include/dba.php index 5e84b95df5..86a3762b44 100644 --- a/include/dba.php +++ b/include/dba.php @@ -91,6 +91,23 @@ class dba { return $this->db; } + /** + * @brief Returns the MySQL server version string + * + * This function discriminate between the deprecated mysql API and the current + * object-oriented mysqli API. Example of returned string: 5.5.46-0+deb8u1 + * + * @return string + */ + public function server_info() { + if ($this->mysqli) { + $return = $this->db->server_info; + } else { + $return = mysql_get_server_info($this->db); + } + return $return; + } + public function q($sql, $onlyquery = false) { global $a; @@ -249,6 +266,15 @@ class dba { } } + function connected() { + if ($this->mysqli) + $connected = $this->db->ping(); + else + $connected = mysql_ping($this->db); + + return $connected; + } + function __destruct() { if ($this->db) if($this->mysqli)