Committing another live hack for which I'm tired of getting conflicts.
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 19 Sep 2011 11:21:59 +0000 (11:21 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 19 Sep 2011 11:21:59 +0000 (11:21 +0000)
Basically I'm overriding wfWikiID to run multiple instances on same database
but with different settings, and I don't want to them mess each others caches.

includes/DefaultSettings.php
includes/GlobalFunctions.php

index b9a6776..207a63d 100644 (file)
@@ -4158,6 +4158,14 @@ $wgParserTestFiles = array(
  */
 $wgParserTestRemote = false;
 
+
+/**
+ * Overwrite the caching key prefix with custom value.  Do not set if using
+ * load balancer, since it depends on the key being in certain format.
+ * @since 1.19
+ */
+$wgWikiID = false;
+
 /** @} */ # end of profiling, testing and debugging }
 
 /************************************************************************//**
index 4a722b5..bdf0840 100644 (file)
@@ -3148,8 +3148,10 @@ function wfForeignMemcKey( $db, $prefix /*, ... */ ) {
  * @return String
  */
 function wfWikiID() {
-       global $wgDBprefix, $wgDBname;
-       if ( $wgDBprefix ) {
+       global $wgDBprefix, $wgDBname, $wgWikiID;
+       if ( $wgWikiID !== false ) {
+               return $wgWikiID;
+       } elseif ( $wgDBprefix ) {
                return "$wgDBname-$wgDBprefix";
        } else {
                return $wgDBname;