From 86c701f290485ac94879fec0305eae65f621f147 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 24 Aug 2015 22:06:55 +0200 Subject: [PATCH] objectcache: Remove use of deprecated $wgSessionsInMemcached Deprecated since MediaWiki 1.20. Change-Id: I3b431714e0d2b21b3911c80bbf2b4b4868634510 --- includes/GlobalFunctions.php | 6 +++--- includes/Setup.php | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index c3740a0146..035ff09061 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3461,10 +3461,10 @@ function wfResetSessionID() { * @param bool $sessionId */ function wfSetupSession( $sessionId = false ) { - global $wgSessionsInMemcached, $wgSessionsInObjectCache, $wgSessionHandler; + global $wgSessionsInObjectCache, $wgSessionHandler; global $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly; - if ( $wgSessionsInObjectCache || $wgSessionsInMemcached ) { + if ( $wgSessionsInObjectCache ) { ObjectCacheSessionHandler::install(); } elseif ( $wgSessionHandler && $wgSessionHandler != ini_get( 'session.save_handler' ) ) { # Only set this if $wgSessionHandler isn't null and session.save_handler @@ -3485,7 +3485,7 @@ function wfSetupSession( $sessionId = false ) { session_start(); MediaWiki\restoreWarnings(); - if ( $wgSessionsInObjectCache || $wgSessionsInMemcached ) { + if ( $wgSessionsInObjectCache ) { ObjectCacheSessionHandler::renewCurrentSession(); } } diff --git a/includes/Setup.php b/includes/Setup.php index 0c1e99df8d..4d7428a2dd 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -477,6 +477,12 @@ if ( $wgMaximalPasswordLength !== false ) { $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength; } +// Backwards compatibility with deprecated alias +// Must be before call to wfSetupSession() +if ( $wgSessionsInMemcached ) { + $wgSessionsInObjectCache = true; +} + Profiler::instance()->scopedProfileOut( $ps_default ); // Disable MWDebug for command line mode, this prevents MWDebug from eating up -- 2.20.1