From b68388811941cea6bcd39daba3c4b991e1b32392 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Wed, 13 Aug 2014 13:45:56 -0700 Subject: [PATCH] Pass $name to default Skin constructor for backwards-compatability This feature was necessary when it was only possible to specify the name of the class a skin used, this was the only way for one class to dynamically serve multiple skins (such as if the skins were purely template based with no PHP or if one skin had different themes to it). It also provided an option for other skins to set $this->skinname dynamically. See code review on I5c442f3c9e. Change-Id: I7315fadf2e26d164ccc4f47b6d883945fa2570da --- includes/Setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Setup.php b/includes/Setup.php index b3e80ea98c..b2fe7b8839 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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 -- 2.20.1