aboutsummaryrefslogtreecommitdiffstats
path: root/includes/DatabasePostgreSQL.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@users.mediawiki.org>2004-09-08 20:36:41 +0000
committerBrion Vibber <brion@users.mediawiki.org>2004-09-08 20:36:41 +0000
commit24619e4c665751ebac59ea959bd99e92bb10018c (patch)
tree2fb4522625b7a32a94b4fd376bfa8087d05eafc7 /includes/DatabasePostgreSQL.php
parent454c47247efba71b0d1c57bf4f4c3a3ff932b86e (diff)
downloadmediawikicore-24619e4c665751ebac59ea959bd99e92bb10018c.tar.gz
mediawikicore-24619e4c665751ebac59ea959bd99e92bb10018c.zip
Add Database::getSoftwareLink() and Database::getServerVersion(), and use
those in Special:Version. Fixes bug 388: Special:Version shows MySQL version when using PostgreSQL http://bugzilla.wikipedia.org/show_bug.cgi?id=388
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/5161
Diffstat (limited to 'includes/DatabasePostgreSQL.php')
-rw-r--r--includes/DatabasePostgreSQL.php38
1 files changed, 28 insertions, 10 deletions
diff --git a/includes/DatabasePostgreSQL.php b/includes/DatabasePostgreSQL.php
index b3e74ec2f699..db4c7d84549d 100644
--- a/includes/DatabasePostgreSQL.php
+++ b/includes/DatabasePostgreSQL.php
@@ -357,18 +357,36 @@ class DatabasePgsql extends Database {
return false;
}
- # Return DB-style timestamp used for MySQL schema
- function timestamp( $ts=0 ) {
- return wfTimestamp(TS_DB,$ts);
- }
-
- function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
- $message = "A database error has occurred\n" .
- "Query: $sql\n" .
- "Function: $fname\n" .
- "Error: $errno $error\n";
+ # Return DB-style timestamp used for MySQL schema
+ function timestamp( $ts=0 ) {
+ return wfTimestamp(TS_DB,$ts);
+ }
+
+ function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
+ $message = "A database error has occurred\n" .
+ "Query: $sql\n" .
+ "Function: $fname\n" .
+ "Error: $errno $error\n";
wfDebugDieBacktrace($message);
}
+
+ /**
+ * @return string wikitext of a link to the server software's web site
+ */
+ function getSoftwareLink() {
+ return "[http://www.postgresql.org/ PostgreSQL]";
+ }
+
+ /**
+ * @return string Version information from the database
+ */
+ function getServerVersion() {
+ $res = $this->query( "SELECT version()" );
+ $row = $this->fetchRow( $res );
+ $version = $row[0];
+ $this->freeResult( $res );
+ return $version;
+ }
}
/**