http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97468
Revision: 97468
Author: nikerabbit
Date: 2011-09-19 11:21:59 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/phase3/includes/DefaultSettings.php
trunk/phase3/includes/GlobalFunctions.php
Modified: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php 2011-09-19 11:09:35 UTC (rev
97467)
+++ trunk/phase3/includes/DefaultSettings.php 2011-09-19 11:21:59 UTC (rev
97468)
@@ -4158,6 +4158,14 @@
*/
$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 }
/************************************************************************//**
Modified: trunk/phase3/includes/GlobalFunctions.php
===================================================================
--- trunk/phase3/includes/GlobalFunctions.php 2011-09-19 11:09:35 UTC (rev
97467)
+++ trunk/phase3/includes/GlobalFunctions.php 2011-09-19 11:21:59 UTC (rev
97468)
@@ -3148,8 +3148,10 @@
* @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;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs