Simplify construction of SkinVector
* Don't require a Config instance to be passed in the constructor, as that breaks skins that extend it. * Don't manually register the skin with SkinFactory, use $wgValidSkinNames Change-Id: Ie8539027c17caff35c1fc52a56676763df667fd9
This commit is contained in:
parent
e3d66a7d38
commit
85d097ba4c
|
@ -35,8 +35,8 @@ class SkinVector extends SkinTemplate {
|
|||
*/
|
||||
private $vectorConfig;
|
||||
|
||||
public function __construct( Config $config ) {
|
||||
$this->vectorConfig = $config;
|
||||
public function __construct() {
|
||||
$this->vectorConfig = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,10 +38,7 @@ $GLOBALS['wgAutoloadClasses']['VectorTemplate'] = __DIR__ . '/VectorTemplate.php
|
|||
$GLOBALS['wgMessagesDirs']['Vector'] = __DIR__ . '/i18n';
|
||||
|
||||
// Register skin
|
||||
SkinFactory::getDefaultInstance()->register( 'vector', 'Vector', function(){
|
||||
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' );
|
||||
return new SkinVector( $config );
|
||||
} );
|
||||
$GLOBALS['wgValidSkinNames']['vector'] = 'Vector';
|
||||
|
||||
// Register config
|
||||
$GLOBALS['wgConfigRegistry']['vector'] = 'GlobalVarConfig::newInstance';
|
||||
|
|
Loading…
Reference in New Issue