From: Niklas Laxström Date: Mon, 19 Sep 2011 11:21:59 +0000 (+0000) Subject: Committing another live hack for which I'm tired of getting conflicts. X-Git-Tag: 1.31.0-rc.0~27567 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=9a4c60e5d9efbb99f8e1bbc798c812cbdcd7b8be;p=lhc%2Fweb%2Fwiklou.git Committing another live hack for which I'm tired of getting conflicts. 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. --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index b9a6776c56..207a63d627 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 } /************************************************************************//** diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 4a722b5865..bdf0840c67 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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;