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;
|
private $vectorConfig;
|
||||||
|
|
||||||
public function __construct( Config $config ) {
|
public function __construct() {
|
||||||
$this->vectorConfig = $config;
|
$this->vectorConfig = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -38,10 +38,7 @@ $GLOBALS['wgAutoloadClasses']['VectorTemplate'] = __DIR__ . '/VectorTemplate.php
|
||||||
$GLOBALS['wgMessagesDirs']['Vector'] = __DIR__ . '/i18n';
|
$GLOBALS['wgMessagesDirs']['Vector'] = __DIR__ . '/i18n';
|
||||||
|
|
||||||
// Register skin
|
// Register skin
|
||||||
SkinFactory::getDefaultInstance()->register( 'vector', 'Vector', function(){
|
$GLOBALS['wgValidSkinNames']['vector'] = 'Vector';
|
||||||
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' );
|
|
||||||
return new SkinVector( $config );
|
|
||||||
} );
|
|
||||||
|
|
||||||
// Register config
|
// Register config
|
||||||
$GLOBALS['wgConfigRegistry']['vector'] = 'GlobalVarConfig::newInstance';
|
$GLOBALS['wgConfigRegistry']['vector'] = 'GlobalVarConfig::newInstance';
|
||||||
|
|
Loading…
Reference in New Issue