From: Platonides Date: Sun, 31 Oct 2010 22:25:29 +0000 (+0000) Subject: Don't increment stats when called from the scripts. X-Git-Tag: 1.31.0-rc.0~34176 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=638bb684802a9cdd3ab8d838525df274ae18f0d5;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/Setup.php b/includes/Setup.php index 8e59c2a614..732e46c8ec 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -308,13 +308,15 @@ if( !wfIniGetBool( 'session.auto_start' ) ) session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' ); if( !defined( 'MW_NO_SESSION' ) ) { - if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) { - wfIncrStats( 'request_with_session' ); - wfSetupSession(); - $wgSessionStarted = true; - } else { - wfIncrStats( 'request_without_session' ); - $wgSessionStarted = false; + if ( !$wgCommandLineMode ) { + if( ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) { + wfIncrStats( 'request_with_session' ); + wfSetupSession(); + $wgSessionStarted = true; + } else { + wfIncrStats( 'request_without_session' ); + $wgSessionStarted = false; + } } }