Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 128 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
Registrar | |
0.00% |
0 / 128 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
registerExtension | |
0.00% |
0 / 128 |
|
0.00% |
0 / 1 |
12 |
1 | <?php |
2 | |
3 | namespace Wikibase\Lexeme; |
4 | |
5 | use Wikibase\Lexeme\MediaWiki\Api\AddForm; |
6 | use Wikibase\Lexeme\MediaWiki\Api\AddSense; |
7 | use Wikibase\Lexeme\MediaWiki\Api\EditFormElements; |
8 | use Wikibase\Lexeme\MediaWiki\Api\EditSenseElements; |
9 | use Wikibase\Lexeme\MediaWiki\Api\MergeLexemes; |
10 | use Wikibase\Lexeme\MediaWiki\Api\RemoveForm; |
11 | use Wikibase\Lexeme\MediaWiki\Api\RemoveSense; |
12 | use Wikibase\Lexeme\MediaWiki\Specials\SpecialMergeLexemes; |
13 | use Wikibase\Lexeme\MediaWiki\Specials\SpecialNewLexeme; |
14 | use Wikibase\Lib\WikibaseSettings; |
15 | |
16 | /** |
17 | * @license GPL-2.0-or-later |
18 | */ |
19 | class Registrar { |
20 | |
21 | public static function registerExtension() { |
22 | global $wgLexemeEnableRepo; |
23 | |
24 | if ( !WikibaseSettings::isRepoEnabled() || !$wgLexemeEnableRepo ) { |
25 | return; |
26 | } |
27 | |
28 | global $wgAPIModules, $wgSpecialPages, $wgResourceModules; |
29 | |
30 | $wgAPIModules['wbladdform'] = [ |
31 | 'class' => AddForm::class, |
32 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Api\AddForm::factory', |
33 | 'services' => [ |
34 | 'WikibaseRepo.ApiHelperFactory', |
35 | 'WikibaseRepo.BaseDataModelSerializerFactory', |
36 | 'WikibaseRepo.EditEntityFactory', |
37 | 'WikibaseRepo.EntityIdParser', |
38 | 'WikibaseRepo.Store', |
39 | 'WikibaseRepo.SummaryFormatter', |
40 | ], |
41 | ]; |
42 | $wgAPIModules['wblremoveform'] = [ |
43 | 'class' => RemoveForm::class, |
44 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Api\RemoveForm::factory', |
45 | 'services' => [ |
46 | 'WikibaseRepo.ApiHelperFactory', |
47 | 'WikibaseRepo.EditEntityFactory', |
48 | 'WikibaseRepo.EntityIdParser', |
49 | 'WikibaseRepo.Store', |
50 | 'WikibaseRepo.SummaryFormatter', |
51 | ], |
52 | ]; |
53 | $wgAPIModules['wbleditformelements'] = [ |
54 | 'class' => EditFormElements::class, |
55 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Api\EditFormElements::factory', |
56 | 'services' => [ |
57 | 'WikibaseRepo.ApiHelperFactory', |
58 | 'WikibaseRepo.BaseDataModelSerializerFactory', |
59 | 'WikibaseRepo.EditEntityFactory', |
60 | 'WikibaseRepo.EntityIdParser', |
61 | 'WikibaseRepo.EntityStore', |
62 | 'WikibaseRepo.Store', |
63 | 'WikibaseRepo.SummaryFormatter', |
64 | ], |
65 | ]; |
66 | $wgAPIModules['wbladdsense'] = [ |
67 | 'class' => AddSense::class, |
68 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Api\AddSense::factory', |
69 | 'services' => [ |
70 | 'WikibaseRepo.ApiHelperFactory', |
71 | 'WikibaseRepo.BaseDataModelSerializerFactory', |
72 | 'WikibaseRepo.ChangeOpFactoryProvider', |
73 | 'WikibaseRepo.EditEntityFactory', |
74 | 'WikibaseRepo.EntityIdParser', |
75 | 'WikibaseRepo.ExternalFormatStatementDeserializer', |
76 | 'WikibaseRepo.Store', |
77 | 'WikibaseRepo.StringNormalizer', |
78 | 'WikibaseRepo.SummaryFormatter', |
79 | ], |
80 | ]; |
81 | $wgAPIModules['wbleditsenseelements'] = [ |
82 | 'class' => EditSenseElements::class, |
83 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Api\EditSenseElements::factory', |
84 | 'services' => [ |
85 | 'WikibaseRepo.ApiHelperFactory', |
86 | 'WikibaseRepo.BaseDataModelSerializerFactory', |
87 | 'WikibaseRepo.ChangeOpFactoryProvider', |
88 | 'WikibaseRepo.EditEntityFactory', |
89 | 'WikibaseRepo.EntityIdParser', |
90 | 'WikibaseRepo.EntityStore', |
91 | 'WikibaseRepo.ExternalFormatStatementDeserializer', |
92 | 'WikibaseRepo.Store', |
93 | 'WikibaseRepo.StringNormalizer', |
94 | 'WikibaseRepo.SummaryFormatter', |
95 | ], |
96 | ]; |
97 | $wgAPIModules['wblremovesense'] = [ |
98 | 'class' => RemoveSense::class, |
99 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Api\RemoveSense::factory', |
100 | 'services' => [ |
101 | 'WikibaseRepo.ApiHelperFactory', |
102 | 'WikibaseRepo.EditEntityFactory', |
103 | 'WikibaseRepo.EntityIdParser', |
104 | 'WikibaseRepo.Store', |
105 | 'WikibaseRepo.SummaryFormatter', |
106 | ], |
107 | ]; |
108 | $wgAPIModules['wblmergelexemes'] = [ |
109 | 'class' => MergeLexemes::class, |
110 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Api\MergeLexemes::factory', |
111 | 'services' => [ |
112 | 'WikibaseRepo.ApiHelperFactory', |
113 | 'WikibaseLexemeMergeLexemesInteractor', |
114 | ], |
115 | ]; |
116 | |
117 | $wgSpecialPages['NewLexeme'] = [ |
118 | 'class' => SpecialNewLexeme::class, |
119 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Specials\SpecialNewLexeme::factory', |
120 | 'services' => [ |
121 | 'LinkRenderer', |
122 | 'StatsdDataFactory', |
123 | 'TempUserConfig', |
124 | 'WikibaseRepo.AnonymousEditWarningBuilder', |
125 | 'WikibaseRepo.EditEntityFactory', |
126 | 'WikibaseRepo.EntityNamespaceLookup', |
127 | 'WikibaseRepo.EntityTitleStoreLookup', |
128 | 'WikibaseRepo.EntityLookup', |
129 | 'WikibaseRepo.EntityIdParser', |
130 | 'WikibaseRepo.Settings', |
131 | 'WikibaseRepo.SummaryFormatter', |
132 | 'WikibaseRepo.EntityIdHtmlLinkFormatterFactory', |
133 | 'WikibaseRepo.FallbackLabelDescriptionLookupFactory', |
134 | 'WikibaseRepo.ValidatorErrorLocalizer', |
135 | 'WikibaseLexemeLemmaTermValidator', |
136 | ], |
137 | ]; |
138 | |
139 | $wgSpecialPages['MergeLexemes'] = [ |
140 | 'class' => SpecialMergeLexemes::class, |
141 | 'factory' => 'Wikibase\Lexeme\MediaWiki\Specials\SpecialMergeLexemes::factory', |
142 | 'services' => [ |
143 | 'PermissionManager', |
144 | 'WikibaseRepo.AnonymousEditWarningBuilder', |
145 | 'WikibaseRepo.EntityTitleLookup', |
146 | 'WikibaseRepo.ExceptionLocalizer', |
147 | 'WikibaseRepo.Settings', |
148 | 'WikibaseRepo.TokenCheckInteractor', |
149 | 'WikibaseLexemeMergeLexemesInteractor', |
150 | ], |
151 | ]; |
152 | |
153 | $wgResourceModules = array_merge( |
154 | $wgResourceModules, |
155 | include __DIR__ . '/../WikibaseLexeme.resources.php' |
156 | ); |
157 | } |
158 | |
159 | } |