r72316 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72315‎ | r72316 | r72317 >
Date:21:39, 3 September 2010
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Follow-up r70970. There's no StubUser any more, so no point in showing the wfDebug on each request.
Modified paths:
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
@@ -397,12 +397,6 @@
398398 header( 'Cache-Control: private' );
399399 return;
400400 } // else no XVO and anonymous, send public headers below
401 - } else /* if public */ {
402 - // Give a debugging message if the user object is unstubbed on a public request
403 - global $wgUser;
404 - if ( !( $wgUser instanceof StubUser ) ) {
405 - wfDebug( __METHOD__ . " \$wgUser is unstubbed on a public request!\n" );
406 - }
407401 }
408402
409403 // If nobody called setCacheMaxAge(), use the (s)maxage parameters

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70970Get rid of StubUser. Constructing a user object isn't quite as intensive as i...demon17:10, 12 August 2010

Comments

#Comment by Nikerabbit (talk | contribs)   21:52, 3 September 2010

I'm interested in the reason why this piece of code was originally written? Was usage of $wgUser something that was not supposed to happen with public requests?

#Comment by Platonides (talk | contribs)   21:56, 3 September 2010

I think that if the request is public, it shouldn't be using User specific data. Was added in r69776 (API cache header rewrite) with the rest of sendCacheHeaders()

#Comment by Catrope (talk | contribs)   13:40, 27 September 2010

That's the reason, yes. At the time, StubUser was a nicely reliable way to detect that $wgUser was being read, but of course that doesn't work anymore.

Status & tagging log