From: Kunal Mehta Date: Wed, 13 Aug 2014 20:45:56 +0000 (-0700) Subject: Pass $name to default Skin constructor for backwards-compatability X-Git-Tag: 1.31.0-rc.0~14441^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=b68388811941cea6bcd39daba3c4b991e1b32392;p=lhc%2Fweb%2Fwiklou.git 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 --- 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