Added a new function DatabaseBase::getDBtype() to get the DB type for messages, updated all subclasses.
Message change needs propagating.
* (bug 19513) RTL fixes for new Search UI
* (bug 16497) Special:Allmessages is paginated
* (bug 18708) CSS plainlinks class now available to all skins
* (bug 19513) RTL fixes for new Search UI
* (bug 16497) Special:Allmessages is paginated
* (bug 18708) CSS plainlinks class now available to all skins
+* (bug 19590) Database error messages no longer have "MySQL" hardcoded as the
+ database type
== API changes in 1.16 ==
== API changes in 1.16 ==
return '(no software link given)';
}
return '(no software link given)';
}
+ /**
+ * Returns the database type for user-visible purposes
+ * e.g. DB error messages
+ * Other uses should just use $wgDBtype
+ *
+ * @return String: Database name for messages
+ */
+ function getDBtype() {
+ return 'Database';
+ }
+
/**
* A string describing the current software version, like from
* mysql_get_server_info(). Will be listed on Special:Version, etc.
/**
* A string describing the current software version, like from
* mysql_get_server_info(). Will be listed on Special:Version, etc.
function getText() {
if ( $this->useMessageCache() ) {
return wfMsg( 'dberrortextcl', htmlspecialchars( $this->getSQL() ),
function getText() {
if ( $this->useMessageCache() ) {
return wfMsg( 'dberrortextcl', htmlspecialchars( $this->getSQL() ),
- htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ) ) . "\n";
+ htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ),
+ htmlspecialchars( $this->db->getDBtype() ) ) . "\n";
} else {
return $this->getMessage();
}
} else {
return $this->getMessage();
}
function getHTML() {
if ( $this->useMessageCache() ) {
return wfMsgNoDB( 'dberrortext', htmlspecialchars( $this->getSQL() ),
function getHTML() {
if ( $this->useMessageCache() ) {
return wfMsgNoDB( 'dberrortext', htmlspecialchars( $this->getSQL() ),
- htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ) );
+ htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ),
+ htmlspecialchars( $this->db->getDBtype() ) );
} else {
return nl2br( htmlspecialchars( $this->getMessage() ) );
}
} else {
return nl2br( htmlspecialchars( $this->getMessage() ) );
}
return "[http://www.ibm.com/software/data/db2/express/?s_cmp=ECDDWW01&s_tact=MediaWiki IBM DB2]";
}
return "[http://www.ibm.com/software/data/db2/express/?s_cmp=ECDDWW01&s_tact=MediaWiki IBM DB2]";
}
+ /**
+ * @return String: Database name for messages
+ */
+ function getDBtype() {
+ return 'IBM DB2';
+ }
+
###
# Fix search crash
###
###
# Fix search crash
###
return "[http://www.microsoft.com/sql/default.mspx Microsoft SQL Server 2005 Home]";
}
return "[http://www.microsoft.com/sql/default.mspx Microsoft SQL Server 2005 Home]";
}
+ /**
+ * @return String: Database name for messages
+ */
+ function getDBtype() {
+ return 'Microsoft SQL Server';
+ }
+
/**
* @return string Version information from the database
*/
/**
* @return string Version information from the database
*/
return '[http://www.mysql.com/ MySQL]';
}
return '[http://www.mysql.com/ MySQL]';
}
+ /**
+ * @return String: Database name for messages
+ */
+ function getDBtype() {
+ return 'MySQL';
+ }
+
public function setTimeout( $timeout ) {
$this->query( "SET net_read_timeout=$timeout" );
$this->query( "SET net_write_timeout=$timeout" );
public function setTimeout( $timeout ) {
$this->query( "SET net_read_timeout=$timeout" );
$this->query( "SET net_write_timeout=$timeout" );
return oci_server_version($this->mConn);
}
return oci_server_version($this->mConn);
}
+ /**
+ * @return String: Database name for messages
+ */
+ function getDBtype() {
+ return 'Oracle';
+ }
+
/**
* Query whether a given table exists (in the given schema, or the default mw one if not given)
*/
/**
* Query whether a given table exists (in the given schema, or the default mw one if not given)
*/
return "[http://www.postgresql.org/ PostgreSQL]";
}
return "[http://www.postgresql.org/ PostgreSQL]";
}
+ /**
+ * @return String: Database name for messages
+ */
+ function getDBtype() {
+ return 'PostgreSQL';
+ }
+
/**
* @return string Version information from the database
*/
/**
* @return string Version information from the database
*/
return "[http://sqlite.org/ SQLite]";
}
return "[http://sqlite.org/ SQLite]";
}
+ /**
+ * @return String: Database name for messages
+ */
+ function getDBtype() {
+ return 'SQLite';
+ }
+
/**
* @return string Version information from the database
*/
/**
* @return string Version information from the database
*/
The last attempted database query was:
<blockquote><tt>$1</tt></blockquote>
from within function "<tt>$2</tt>".
The last attempted database query was:
<blockquote><tt>$1</tt></blockquote>
from within function "<tt>$2</tt>".
-MySQL returned error "<tt>$3: $4</tt>".',
+$5 returned error "<tt>$3: $4</tt>".',
'dberrortextcl' => 'A database query syntax error has occurred.
The last attempted database query was:
"$1"
from within function "$2".
'dberrortextcl' => 'A database query syntax error has occurred.
The last attempted database query was:
"$1"
from within function "$2".
-MySQL returned error "$3: $4"',
+$5 returned error "$3: $4"',
'laggedslavemode' => "'''Warning:''' Page may not contain recent updates.",
'readonly' => 'Database locked',
'enterlockreason' => 'Enter a reason for the lock, including an estimate of when the lock will be released',
'laggedslavemode' => "'''Warning:''' Page may not contain recent updates.",
'readonly' => 'Database locked',
'enterlockreason' => 'Enter a reason for the lock, including an estimate of when the lock will be released',