r97468 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97467‎ | r97468 | r97469 >
Date:11:21, 19 September 2011
Author:nikerabbit
Status:reverted (Comments)
Tags:
Comment:
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 (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -3148,8 +3148,10 @@
31493149 * @return String
31503150 */
31513151 function wfWikiID() {
3152 - global $wgDBprefix, $wgDBname;
3153 - if ( $wgDBprefix ) {
 3152+ global $wgDBprefix, $wgDBname, $wgWikiID;
 3153+ if ( $wgWikiID !== false ) {
 3154+ return $wgWikiID;
 3155+ } elseif ( $wgDBprefix ) {
31543156 return "$wgDBname-$wgDBprefix";
31553157 } else {
31563158 return $wgDBname;
Index: trunk/phase3/includes/DefaultSettings.php
@@ -4158,6 +4158,14 @@
41594159 */
41604160 $wgParserTestRemote = false;
41614161
 4162+
 4163+/**
 4164+ * Overwrite the caching key prefix with custom value. Do not set if using
 4165+ * load balancer, since it depends on the key being in certain format.
 4166+ * @since 1.19
 4167+ */
 4168+$wgWikiID = false;
 4169+
41624170 /** @} */ # end of profiling, testing and debugging }
41634171
41644172 /************************************************************************//**

Follow-up revisions

RevisionCommit summaryAuthorDate
r105523Revert r97468 and implemented it in another way suggested by Timnikerabbit09:07, 8 December 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   00:30, 11 November 2011

A little icky...

#Comment by 😂 (talk | contribs)   00:35, 11 November 2011
#Comment by Nikerabbit (talk | contribs)   08:01, 11 November 2011

I see. This time there is different justification and a note that it does not work loadbalancer. I'm open to better ideas, but the whole point was to save time and hassle, so I'm not enthusiastic about large scale rewrites :)

#Comment by Nikerabbit (talk | contribs)   08:12, 11 November 2011

I see. This time there is different justification and a note that it does not work loadbalancer. I'm open to better ideas, but the whole point was to save time and hassle, so I'm not enthusiastic about large scale rewrites :)

#Comment by Tim Starling (talk | contribs)   00:28, 25 November 2011

Maybe we can add a new variable to configure the cache prefix, and stop using wfWikiID() for that. wfMemcKey() with no arguments can return the cache prefix if someone needs to know it.

Status & tagging log