X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=189855e82ccd946b03fbe2904c103d61cb2ac883;hb=ae69acacf567077b3f49d1fe6c3f3770e72a9093;hp=4854727d687b5c7ed127732059768fddcc205036;hpb=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index 4854727d68..189855e82c 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -517,6 +517,11 @@ if ( $wgPHPSessionHandling !== 'enable' && ) { $wgPHPSessionHandling = 'warn'; } +if ( defined( 'MW_NO_SESSION' ) ) { + // If the entry point wants no session, force 'disable' here unless they + // specifically set it to the (undocumented) 'warn'. + $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable'; +} Profiler::instance()->scopedProfileOut( $ps_default ); @@ -702,10 +707,13 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' ); } - // Create the SessionManager singleton and set up our session handler - MediaWiki\Session\PHPSessionHandler::install( - MediaWiki\Session\SessionManager::singleton() - ); + // Create the SessionManager singleton and set up our session handler, + // unless we're specifically asked not to. + if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) { + MediaWiki\Session\PHPSessionHandler::install( + MediaWiki\Session\SessionManager::singleton() + ); + } // Initialize the session try { @@ -740,6 +748,16 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { session_id( $session->getId() ); MediaWiki\quietCall( 'session_start' ); } + + unset( $session ); +} else { + // Even if we didn't set up a global Session, still install our session + // handler unless specifically requested not to. + if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) { + MediaWiki\Session\PHPSessionHandler::install( + MediaWiki\Session\SessionManager::singleton() + ); + } } Profiler::instance()->scopedProfileOut( $ps_session ); @@ -809,10 +827,5 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { wfDebug( "Fully initialised\n" ); $wgFullyInitialised = true; -// T125455 -if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { - MediaWiki\Session\SessionManager::singleton()->checkIpLimits(); -} - Profiler::instance()->scopedProfileOut( $ps_extensions ); Profiler::instance()->scopedProfileOut( $ps_setup );