Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -587,6 +587,19 @@ |
588 | 588 | $wgSharedDB = null; |
589 | 589 | |
590 | 590 | /** |
| 591 | + * List of database tables (without prefixes) to share when $wgSharedDB is enabled. |
| 592 | + * This only includes the user table by default for backwards compatibility. |
| 593 | + * However you may remove it so that you can enable extensions using the shared DB |
| 594 | + * without having shared users. Or you can add in another table, such as interwiki |
| 595 | + * to force MediaWiki to use the shared version of the table instead. |
| 596 | + * |
| 597 | + * Be carefull with sharing tables. The images, revisions, pages, and many of the |
| 598 | + * other tables may have bad side effects if you share them. |
| 599 | + * EXPERIMENTAL |
| 600 | + */ |
| 601 | +$wgSharedDBtables = array( 'user' ); |
| 602 | + |
| 603 | +/** |
591 | 604 | * Database load balancer |
592 | 605 | * This is a two-dimensional array, an array of server info structures |
593 | 606 | * Fields are: |
Index: trunk/phase3/includes/Database.php |
— | — | @@ -1365,13 +1365,15 @@ |
1366 | 1366 | * @param string $name database table name |
1367 | 1367 | */ |
1368 | 1368 | function tableName( $name ) { |
1369 | | - global $wgSharedDB; |
| 1369 | + global $wgSharedDB, $wgSharedDBtables; |
1370 | 1370 | # Skip quoted literals |
1371 | 1371 | if ( $name{0} != '`' ) { |
1372 | 1372 | if ( $this->mTablePrefix !== '' && strpos( $name, '.' ) === false ) { |
1373 | 1373 | $name = "{$this->mTablePrefix}$name"; |
1374 | 1374 | } |
1375 | | - if ( isset( $wgSharedDB ) && "{$this->mTablePrefix}user" == $name ) { |
| 1375 | + if ( isset( $wgSharedDB ) && isset( $wgSharedDBtables ) |
| 1376 | + && substr( $name, 0, strlen($this->mTablePrefix) ) == $this->mTablePrefix |
| 1377 | + && in_array( substr( $name, strlen($this->mTablePrefix) ), $wgSharedDBtables ) ) { |
1376 | 1378 | $name = "`$wgSharedDB`.`$name`"; |
1377 | 1379 | } else { |
1378 | 1380 | # Standard quoting |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -99,6 +99,8 @@ |
100 | 100 | * (bug 709) Cannot rename/move images and other media files [EXPERIMENTAL] |
101 | 101 | * Custom rollback summaries now accept the same arguments as the default message |
102 | 102 | * (bug 12542) Added hooks for expansion of Special:Listusers |
| 103 | +* Added new variable $wgSharedDBtables for altering the list of tables which are |
| 104 | + shared when $wgSharedDB is enabled. |
103 | 105 | |
104 | 106 | === Bug fixes in 1.13 === |
105 | 107 | |