Revert r34199, r34205 for now.
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 5 May 2008 22:21:01 +0000 (22:21 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 5 May 2008 22:21:01 +0000 (22:21 +0000)
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.

includes/Database.php
includes/DefaultSettings.php

index 2b20d98..1f19226 100644 (file)
@@ -1365,15 +1365,13 @@ class Database {
         * @param string $name database table name
         */
        function tableName( $name ) {
-               global $wgSharedDB, $wgSharedDBtables;
+               global $wgSharedDB;
                # Skip quoted literals
                if ( $name{0} != '`' ) {
                        if ( $this->mTablePrefix !== '' &&  strpos( $name, '.' ) === false ) {
                                $name = "{$this->mTablePrefix}$name";
                        }
-                       if ( isset( $wgSharedDB ) && isset( $wgSharedDBtables )
-                        && substr( $name, 0, strlen($this->mTablePrefix) ) == $this->mTablePrefix
-                        && in_array( substr( $name, strlen($this->mTablePrefix) ), $wgSharedDBtables ) ) {
+                       if ( isset( $wgSharedDB ) && "{$this->mTablePrefix}user" == $name ) {
                                $name = "`$wgSharedDB`.`$name`";
                        } else {
                                # Standard quoting
index 7c27090..9b2928a 100644 (file)
@@ -577,25 +577,14 @@ $wgAllDBsAreLocalhost = false;
 /** Live high performance sites should disable this - some checks acquire giant mysql locks */
 $wgCheckDBSchema = true;
 
-/**
- * Shared database for multiple wikis.
- * The server for this database must be the same as for the main database.
- * EXPERIMENTAL
- */
-$wgSharedDB = null;
 
 /**
- * List of database tables (without prefixes) to share when $wgSharedDB is enabled.
- * This only includes the user table by default for backwards compatibility.
- * However you may remove it so that you can enable extensions using the shared
- * DB without having shared users. Or you can add in another table, such as
- * interwiki to force MediaWiki to use the shared version of the table instead.
- * 
- * Be carefull with sharing tables. The images, revisions, pages, and many of
- * the other tables may have bad side effects if you share them.
+ * Shared database for multiple wikis. Presently used for storing a user table
+ * for single sign-on. The server for this database must be the same as for the
+ * main database.
  * EXPERIMENTAL
  */
-$wgSharedDBtables = array( 'user' );
+$wgSharedDB = null;
 
 /**
  * Database load balancer