Commit fc283904 authored by Dries's avatar Dries

- Patch #878198 by pwolanin, Damien Tournoud: add back a method to the DB...

- Patch #878198 by pwolanin, Damien Tournoud: add back a method to the DB driver interface that reports the server version.
parent 8ec40cc2
......@@ -1069,7 +1069,9 @@ protected function generateTemporaryTableName() {
/**
* Returns the version of the database server.
*/
abstract public function version();
public function version() {
return $this->getAttribute(PDO::ATTR_SERVER_VERSION);
}
/**
* Determines if this driver supports transactions.
......
......@@ -79,11 +79,6 @@ public function driver() {
return 'mysql';
}
public function version() {
$data = $this->query('SHOW variables LIKE :name', array(':name' => 'version'))->fetchAssoc();
return $data['value'];
}
public function databaseType() {
return 'mysql';
}
......
......@@ -126,10 +126,6 @@ public function driver() {
return 'pgsql';
}
public function version() {
return $this->query('SHOW SERVER_VERSION')->fetchField();
}
public function databaseType() {
return 'pgsql';
}
......
......@@ -182,10 +182,6 @@ public function driver() {
return 'sqlite';
}
public function version() {
return $this->query('SELECT sqlite_version()')->fetchField();
}
public function databaseType() {
return 'sqlite';
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment