mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-28 01:00:02 +00:00
34a1a297c2
Replace $wgGadgetsRepoClass with $wgGadgetsRepo. Change-Id: I3dc1e29d1c3c65a18c206e7aa50e5bf31a55cc21
22 lines
762 B
PHP
22 lines
762 B
PHP
<?php
|
|
|
|
use MediaWiki\Extension\Gadgets\GadgetDefinitionNamespaceRepo;
|
|
use MediaWiki\Extension\Gadgets\GadgetRepo;
|
|
use MediaWiki\Extension\Gadgets\MediaWikiGadgetsDefinitionRepo;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
return [
|
|
'GadgetsRepo' => static function ( MediaWikiServices $services ): GadgetRepo {
|
|
$wanCache = $services->getMainWANObjectCache();
|
|
$revisionLookup = $services->getRevisionLookup();
|
|
switch ( $services->getMainConfig()->get( 'GadgetsRepo' ) ) {
|
|
case 'definition':
|
|
return new MediaWikiGadgetsDefinitionRepo( $wanCache, $revisionLookup );
|
|
case 'json':
|
|
return new GadgetDefinitionNamespaceRepo( $wanCache, $revisionLookup );
|
|
default:
|
|
throw new InvalidArgumentException( 'Unexpected value for $wgGadgetsRepo' );
|
|
}
|
|
},
|
|
];
|