r70202 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70201‎ | r70202 | r70203 >
Date:19:51, 30 July 2010
Author:mah
Status:reverted (Comments)
Tags:
Comment:
Make sure we get a good memCached object.
Modified paths:
  • /trunk/phase3/includes/parser/ParserCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/ParserCache.php
@@ -4,6 +4,8 @@
55 * @todo document
66 */
77 class ParserCache {
 8+ private $mMemc;
 9+
810 /**
911 * Get an instance of this object
1012 */
@@ -23,6 +25,10 @@
2426 * @param $memCached Object
2527 */
2628 function __construct( $memCached ) {
 29+ if ( !$memCached ) {
 30+ global $parserMemc;
 31+ $parserMemc = $memCached = wfGetParserCacheStorage();
 32+ }
2733 $this->mMemc = $memCached;
2834 }
2935

Follow-up revisions

RevisionCommit summaryAuthorDate
r77748Revert r70202. Replace with an exception.platonides23:36, 4 December 2010

Comments

#Comment by Platonides (talk | contribs)   23:03, 4 December 2010

Why? An exception would seem more appropiate.

#Comment by MarkAHershberger (talk | contribs)   23:20, 4 December 2010

Feel free to revert. I had a good reason for this, but now I've forgotten. IIRC, I was getting an exception predictably and this was how I solved it.

If you revert, I'll just come back to you for help solving the problem. ;)

#Comment by Platonides (talk | contribs)   23:38, 4 December 2010

Reverted in r77748.

Everything goes via the singleton, so I can only think that it could be failing due to a bad $parserMemc. But $parserMemc is initialized in Setup.php

A consequence of the fun we had with globals and tests?

Status & tagging log