Merge "Add a test for ApiFormatNone"
[lhc/web/wiklou.git] / includes / Setup.php
index b3e80ea..0c5cf92 100644 (file)
@@ -268,9 +268,9 @@ if ( $wgSkipSkin ) {
 call_user_func( function() use ( $wgValidSkinNames ) {
        $factory = SkinFactory::getDefaultInstance();
        foreach ( $wgValidSkinNames as $name => $skin ) {
-               $factory->register( $name, $skin, function() use ( $skin ) {
+               $factory->register( $name, $skin, function() use ( $name, $skin ) {
                        $class = "Skin$skin";
-                       return new $class;
+                       return new $class( $name );
                } );
        }
        // Register a hidden "fallback" skin
@@ -405,13 +405,14 @@ if ( $wgCookieSecure === 'detect' ) {
        $wgCookieSecure = ( WebRequest::detectProtocol() === 'https' );
 }
 
-if ( $wgRC2UDPAddress ) {
-       $wgRCFeeds['default'] = array(
-               'formatter' => 'IRCColourfulRCFeedFormatter',
-               'uri' => "udp://$wgRC2UDPAddress:$wgRC2UDPPort/$wgRC2UDPPrefix",
-               'add_interwiki_prefix' => &$wgRC2UDPInterwikiPrefix,
-               'omit_bots' => &$wgRC2UDPOmitBots,
-       );
+// Back compatibility for $wgRateLimitLog deprecated with 1.23
+if ( $wgRateLimitLog && !array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
+       $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
+}
+
+if ( $wgProfileOnly ) {
+       $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
+       $wgDebugLogFile = '';
 }
 
 wfProfileOut( $fname . '-defaults' );
@@ -478,16 +479,6 @@ if ( $wgTmpDirectory === false ) {
        wfProfileOut( $fname . '-tempDir' );
 }
 
-// Back compatibility for $wgRateLimitLog deprecated with 1.23
-if ( $wgRateLimitLog && !array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
-       $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
-}
-
-if ( $wgProfileOnly ) {
-       $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile;
-       $wgDebugLogFile = '';
-}
-
 wfProfileOut( $fname . '-defaults2' );
 wfProfileIn( $fname . '-misc1' );
 
@@ -550,15 +541,15 @@ wfRunHooks( 'SetupAfterCache' );
 
 wfProfileIn( $fname . '-session' );
 
-// If session.auto_start is there, we can't touch session name
-if ( !wfIniGetBool( 'session.auto_start' ) ) {
-       session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
-}
+if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
+       // If session.auto_start is there, we can't touch session name
+       if ( !wfIniGetBool( 'session.auto_start' ) ) {
+               session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
+       }
 
-if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode &&
-       ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) )
-) {
-       wfSetupSession();
+       if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
+               wfSetupSession();
+       }
 }
 
 wfProfileOut( $fname . '-session' );