http://www.mediawiki.org/wiki/Special:Code/MediaWiki/55501
Revision: 55501 Author: mrzman Date: 2009-08-22 20:17:28 +0000 (Sat, 22 Aug 2009) Log Message: ----------- Mostly revert r53358 and r53365 per comments on code review. Change message to just say "Database" and remove the getDBtypeForMsg function (since I can't think of any other use for it) Modified Paths: -------------- trunk/phase3/includes/db/Database.php trunk/phase3/includes/db/DatabaseIbm_db2.php trunk/phase3/includes/db/DatabaseMssql.php trunk/phase3/includes/db/DatabaseMysql.php trunk/phase3/includes/db/DatabaseOracle.php trunk/phase3/includes/db/DatabasePostgres.php trunk/phase3/includes/db/DatabaseSqlite.php trunk/phase3/languages/messages/MessagesEn.php Modified: trunk/phase3/includes/db/Database.php =================================================================== --- trunk/phase3/includes/db/Database.php 2009-08-22 20:15:22 UTC (rev 55500) +++ trunk/phase3/includes/db/Database.php 2009-08-22 20:17:28 UTC (rev 55501) @@ -1966,15 +1966,6 @@ abstract function getSoftwareLink(); /** - * Returns the database type for user-visible purposes - * e.g. DB error messages - * Other uses should just use $wgDBtype - * - * @return String: Database type for use in messages - */ - abstract function getDBtypeForMsg(); - - /** * A string describing the current software version, like from * mysql_get_server_info(). Will be listed on Special:Version, etc. * @@ -2601,8 +2592,7 @@ function getText() { if ( $this->useMessageCache() ) { return wfMsg( 'dberrortextcl', htmlspecialchars( $this->getSQL() ), - htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ), - htmlspecialchars( $this->db->getDBtypeForMsg() ) ) . "\n"; + htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ) ) . "\n"; } else { return $this->getMessage(); } @@ -2629,8 +2619,7 @@ function getHTML() { if ( $this->useMessageCache() ) { return wfMsgNoDB( 'dberrortext', htmlspecialchars( $this->getSQL() ), - htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ), - htmlspecialchars( $this->db->getDBtypeForMsg() ) ); + htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ) ); } else { return nl2br( htmlspecialchars( $this->getMessage() ) ); } Modified: trunk/phase3/includes/db/DatabaseIbm_db2.php =================================================================== --- trunk/phase3/includes/db/DatabaseIbm_db2.php 2009-08-22 20:15:22 UTC (rev 55500) +++ trunk/phase3/includes/db/DatabaseIbm_db2.php 2009-08-22 20:17:28 UTC (rev 55501) @@ -1435,13 +1435,6 @@ } /** - * @return String: Database type for use in messages - */ - function getDBtypeForMsg() { - return 'IBM DB2'; - } - - /** * Get search engine class. All subclasses of this * need to implement this if they wish to use searching. * Modified: trunk/phase3/includes/db/DatabaseMssql.php =================================================================== --- trunk/phase3/includes/db/DatabaseMssql.php 2009-08-22 20:15:22 UTC (rev 55500) +++ trunk/phase3/includes/db/DatabaseMssql.php 2009-08-22 20:17:28 UTC (rev 55501) @@ -900,13 +900,6 @@ } /** - * @return String: Database type for use in messages - */ - function getDBtypeForMsg() { - return 'Microsoft SQL Server'; - } - - /** * @return string Version information from the database */ function getServerVersion() { Modified: trunk/phase3/includes/db/DatabaseMysql.php =================================================================== --- trunk/phase3/includes/db/DatabaseMysql.php 2009-08-22 20:15:22 UTC (rev 55500) +++ trunk/phase3/includes/db/DatabaseMysql.php 2009-08-22 20:17:28 UTC (rev 55501) @@ -293,13 +293,6 @@ return false; } - /** - * @return String: Database type for use in messages - */ - function getDBtypeForMsg() { - return 'MySQL'; - } - public function setTimeout( $timeout ) { $this->query( "SET net_read_timeout=$timeout" ); $this->query( "SET net_write_timeout=$timeout" ); Modified: trunk/phase3/includes/db/DatabaseOracle.php =================================================================== --- trunk/phase3/includes/db/DatabaseOracle.php 2009-08-22 20:15:22 UTC (rev 55500) +++ trunk/phase3/includes/db/DatabaseOracle.php 2009-08-22 20:17:28 UTC (rev 55501) @@ -736,13 +736,6 @@ } /** - * @return String: Database type for use in messages - */ - function getDBtypeForMsg() { - return 'Oracle'; - } - - /** * @return string Version information from the database */ function getServerVersion() { Modified: trunk/phase3/includes/db/DatabasePostgres.php =================================================================== --- trunk/phase3/includes/db/DatabasePostgres.php 2009-08-22 20:15:22 UTC (rev 55500) +++ trunk/phase3/includes/db/DatabasePostgres.php 2009-08-22 20:17:28 UTC (rev 55501) @@ -1048,13 +1048,6 @@ } /** - * @return String: Database type for use in messages - */ - function getDBtypeForMsg() { - return 'PostgreSQL'; - } - - /** * @return string Version information from the database */ function getServerVersion() { Modified: trunk/phase3/includes/db/DatabaseSqlite.php =================================================================== --- trunk/phase3/includes/db/DatabaseSqlite.php 2009-08-22 20:15:22 UTC (rev 55500) +++ trunk/phase3/includes/db/DatabaseSqlite.php 2009-08-22 20:17:28 UTC (rev 55501) @@ -292,13 +292,6 @@ } /** - * @return String: Database type for use in messages - */ - function getDBtypeForMsg() { - return 'SQLite'; - } - - /** * @return string Version information from the database */ function getServerVersion() { Modified: trunk/phase3/languages/messages/MessagesEn.php =================================================================== --- trunk/phase3/languages/messages/MessagesEn.php 2009-08-22 20:15:22 UTC (rev 55500) +++ trunk/phase3/languages/messages/MessagesEn.php 2009-08-22 20:17:28 UTC (rev 55501) @@ -955,12 +955,12 @@ The last attempted database query was: <blockquote><tt>$1</tt></blockquote> from within function "<tt>$2</tt>". -$5 returned error "<tt>$3: $4</tt>".', +Database 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". -$5 returned error "$3: $4"', +Database 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', _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs