public function version()
{
if (isset($this->data_cache['version'])) {
return $this->data_cache['version'];
}
// Not all subdrivers support the getAttribute() method
try {
return $this->data_cache['version'] = $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION);
} catch (PDOException $e) {
return parent::version();
}
}
/** * Database version number * * @return string */ public function version() { if (isset($this->data_cache['version'])) { return $this->data_cache['version']; } $version_string = parent::version(); if (preg_match('#Release\\s(?<version>\\d+(?:\\.\\d+)+)#', $version_string, $match)) { return $this->data_cache['version'] = $match[1]; } return FALSE; }