r34278 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34277‎ | r34278 | r34279 >
Date:22:21, 5 May 2008
Author:brion
Status:old
Tags:
Comment:
Revert r34199, r34205 for now.
I don't really like the var name $wgSharedDBtables (inconsistent caps).

Compare with Gregory's patch on bug 2396:
https://bugzilla.wikimedia.org/show_bug.cgi?id=2396
https://bugzilla.wikimedia.org/attachment.cgi?id=3610

That uses a var named $wgSharedTables, but makes it more flexible (allowing arbitrary DB and prefix per table), which may or may not be a super idea.
Modified paths:
  • /trunk/phase3/includes/Database.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -577,27 +577,16 @@
578578 /** Live high performance sites should disable this - some checks acquire giant mysql locks */
579579 $wgCheckDBSchema = true;
580580
 581+
581582 /**
582 - * Shared database for multiple wikis.
583 - * The server for this database must be the same as for the main database.
 583+ * Shared database for multiple wikis. Presently used for storing a user table
 584+ * for single sign-on. The server for this database must be the same as for the
 585+ * main database.
584586 * EXPERIMENTAL
585587 */
586588 $wgSharedDB = null;
587589
588590 /**
589 - * List of database tables (without prefixes) to share when $wgSharedDB is enabled.
590 - * This only includes the user table by default for backwards compatibility.
591 - * However you may remove it so that you can enable extensions using the shared
592 - * DB without having shared users. Or you can add in another table, such as
593 - * interwiki to force MediaWiki to use the shared version of the table instead.
594 - *
595 - * Be carefull with sharing tables. The images, revisions, pages, and many of
596 - * the other tables may have bad side effects if you share them.
597 - * EXPERIMENTAL
598 - */
599 -$wgSharedDBtables = array( 'user' );
600 -
601 -/**
602591 * Database load balancer
603592 * This is a two-dimensional array, an array of server info structures
604593 * Fields are:
Index: trunk/phase3/includes/Database.php
@@ -1365,15 +1365,13 @@
13661366 * @param string $name database table name
13671367 */
13681368 function tableName( $name ) {
1369 - global $wgSharedDB, $wgSharedDBtables;
 1369+ global $wgSharedDB;
13701370 # Skip quoted literals
13711371 if ( $name{0} != '`' ) {
13721372 if ( $this->mTablePrefix !== '' && strpos( $name, '.' ) === false ) {
13731373 $name = "{$this->mTablePrefix}$name";
13741374 }
1375 - if ( isset( $wgSharedDB ) && isset( $wgSharedDBtables )
1376 - && substr( $name, 0, strlen($this->mTablePrefix) ) == $this->mTablePrefix
1377 - && in_array( substr( $name, strlen($this->mTablePrefix) ), $wgSharedDBtables ) ) {
 1375+ if ( isset( $wgSharedDB ) && "{$this->mTablePrefix}user" == $name ) {
13781376 $name = "`$wgSharedDB`.`$name`";
13791377 } else {
13801378 # Standard quoting

Follow-up revisions

RevisionCommit summaryAuthorDate
r34353New config variables. $wgSharedPrefix and $wgSharedTables....dantman04:44, 7 May 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r34199New variable $wgSharedDBtables. This allows altering of the list of tables wh...dantman09:00, 4 May 2008
r34205Removed the note about that $wgSharedDB only works for user tableialex13:22, 4 May 2008

Status & tagging log