r75753 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75752‎ | r75753 | r75754 >
Date:22:25, 31 October 2010
Author:platonides
Status:ok
Tags:
Comment:
Don't increment stats when called from the scripts.
This avoids things like PHPUnit opening a db connection just for this due to the default SqDlBagOStuff.
Modified paths:
  • /trunk/phase3/includes/Setup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Setup.php
@@ -308,13 +308,15 @@
309309 session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
310310
311311 if( !defined( 'MW_NO_SESSION' ) ) {
312 - if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) {
313 - wfIncrStats( 'request_with_session' );
314 - wfSetupSession();
315 - $wgSessionStarted = true;
316 - } else {
317 - wfIncrStats( 'request_without_session' );
318 - $wgSessionStarted = false;
 312+ if ( !$wgCommandLineMode ) {
 313+ if( ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) {
 314+ wfIncrStats( 'request_with_session' );
 315+ wfSetupSession();
 316+ $wgSessionStarted = true;
 317+ } else {
 318+ wfIncrStats( 'request_without_session' );
 319+ $wgSessionStarted = false;
 320+ }
319321 }
320322 }
321323

Follow-up revisions

RevisionCommit summaryAuthorDate
r75781Followup r75753, combine these into one if blockdemon11:50, 1 November 2010

Status & tagging log