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
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