r105372 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105371‎ | r105372 | r105373 >
Date:22:37, 6 December 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
* (bug 32786) Fix backwards compatibility for extensions using 1.17's Database::newFromType()

Patch based on https://bugzilla.wikimedia.org/attachment.cgi?id=9604 by Solitarius -- thanks!
Added a conversion for a changed tablePrefix / tableprefix bit.
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -636,6 +636,19 @@
637637 }
638638
639639 /**
 640+ * Same as new factory( ... ), kept for backward compatibility
 641+ * @deprecated since 1.18
 642+ * @see Database::factory()
 643+ */
 644+ public final static function newFromType( $dbType, $p = array() ) {
 645+ wfDeprecated( __METHOD__ );
 646+ if ( isset( $p['tableprefix'] ) ) {
 647+ $p['tablePrefix'] = $p['tableprefix'];
 648+ }
 649+ return self::factory( $dbType, $p );
 650+ }
 651+
 652+ /**
640653 * Given a DB type, construct the name of the appropriate child class of
641654 * DatabaseBase. This is designed to replace all of the manual stuff like:
642655 * $class = 'Database' . ucfirst( strtolower( $type ) );

Sign-offs

UserFlagDate
Solitariustested13:56, 9 December 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r105706MFT to REL1_18...hashar20:31, 9 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90430Fixes for r80864 for 1.18 backport:...tstarling07:00, 20 June 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   22:39, 6 December 2011

Needs merge to 1.18 for 1.18.1 point release.

#Comment by Solitarius (talk | contribs)   13:56, 9 December 2011

Thanks for the patch, it's now in place in my production environnement!

Status & tagging log