Use setContentLang() instead of setMwGlobals()
[lhc/web/wiklou.git] / docs / extension.schema.v2.json
1 {
2 "$schema": "http://json-schema.org/schema#",
3 "description": "MediaWiki extension.json schema",
4 "type": "object",
5 "additionalProperties": false,
6 "properties": {
7 "manifest_version": {
8 "type": "integer",
9 "description": "Version of the extension.json schema the extension.json file is in.",
10 "required": true
11 },
12 "name": {
13 "type": "string",
14 "description": "The extension's canonical name.",
15 "required": true
16 },
17 "namemsg": {
18 "type": "string",
19 "description": "i18n message key of the extension's name."
20 },
21 "type": {
22 "type": "string",
23 "description": "The extension's type, as an index to $wgExtensionCredits.",
24 "default": "other"
25 },
26 "author": {
27 "type": [
28 "string",
29 "array"
30 ],
31 "description": "Extension's authors.",
32 "items": {
33 "type": "string"
34 }
35 },
36 "version": {
37 "type": "string",
38 "description": "The version of this release of the extension."
39 },
40 "url": {
41 "type": "string",
42 "description": "URL to the homepage for the extension.",
43 "format": "uri-reference"
44 },
45 "description": {
46 "type": "string",
47 "description": "Raw description of the extension."
48 },
49 "descriptionmsg": {
50 "type": "string",
51 "description": "Message key for a i18n message describing the extension."
52 },
53 "license-name": {
54 "type": "string",
55 "description": "SPDX identifier for the license under which the extension is released."
56 },
57 "requires": {
58 "type": "object",
59 "description": "Indicates what versions of MediaWiki core or extensions are required. This syntax may be extended in the future, for example to check dependencies between other services.",
60 "additionalProperties": false,
61 "properties": {
62 "MediaWiki": {
63 "type": "string",
64 "description": "Version constraint string against MediaWiki core."
65 },
66 "extensions": {
67 "type": "object",
68 "description": "Set of version constraint strings against specific extensions."
69 },
70 "skins": {
71 "type": "object",
72 "description": "Set of version constraint strings against specific skins."
73 }
74 }
75 },
76 "ResourceFileModulePaths": {
77 "type": "object",
78 "description": "Default paths to use for all ResourceLoader file modules",
79 "additionalProperties": false,
80 "properties": {
81 "localBasePath": {
82 "type": "string",
83 "description": "Base path to prepend to all local paths, relative to current directory"
84 },
85 "remoteExtPath": {
86 "type": "string",
87 "description": "Base path to prepend to all remote paths, relative to $wgExtensionAssetsPath"
88 },
89 "remoteSkinPath": {
90 "type": "string",
91 "description": "Base path to prepend to all remote paths, relative to $wgStylePath"
92 }
93 }
94 },
95 "ResourceModules": {
96 "type": "object",
97 "description": "ResourceLoader modules to register",
98 "patternProperties": {
99 "^[a-zA-Z0-9-\\.]+$": {
100 "type": "object",
101 "anyOf": [
102 {
103 "description": "A ResourceLoaderFileModule definition",
104 "additionalProperties": false,
105 "properties": {
106 "localBasePath": {
107 "type": "string",
108 "description": "Base path to prepend to all local paths in $options. Defaults to $IP"
109 },
110 "remoteBasePath": {
111 "type": "string",
112 "description": "Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath"
113 },
114 "remoteExtPath": {
115 "type": "string",
116 "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath"
117 },
118 "skipFunction": {
119 "type": "string",
120 "description": "Path to a file containing a JavaScript \"skip function\", if desired."
121 },
122 "scripts": {
123 "type": ["string", "array"],
124 "description": "Scripts to always include (array of file paths)",
125 "items": {
126 "type": "string"
127 }
128 },
129 "languageScripts": {
130 "type": "object",
131 "description": "Scripts to include in specific language contexts (mapping of language code to file path(s))",
132 "patternProperties": {
133 "^[a-zA-Z0-9-]{2,}$": {
134 "type": [
135 "string",
136 "array"
137 ],
138 "items": {
139 "type": "string"
140 }
141 }
142 }
143 },
144 "skinScripts": {
145 "type": "object",
146 "description": "Scripts to include in specific skin contexts (mapping of skin name to script(s)",
147 "patternProperties": {
148 ".+": {
149 "type": [
150 "string",
151 "array"
152 ],
153 "items": {
154 "type": "string"
155 }
156 }
157 }
158 },
159 "debugScripts": {
160 "type": ["string", "array"],
161 "description": "Scripts to include in debug contexts",
162 "items": {
163 "type": "string"
164 }
165 },
166 "loaderScripts": {
167 "type": ["string", "array"],
168 "description": "Scripts to include in the startup module",
169 "items": {
170 "type": "string"
171 }
172 },
173 "dependencies": {
174 "type": ["string", "array"],
175 "description": "Modules which must be loaded before this module",
176 "items": {
177 "type": "string"
178 }
179 },
180 "styles": {
181 "type": ["string", "array", "object"],
182 "description": "Styles to always load",
183 "items": {
184 "type": "string"
185 }
186 },
187 "skinStyles": {
188 "type": "object",
189 "description": "Styles to include in specific skin contexts (mapping of skin name to style(s))",
190 "patternProperties": {
191 ".+": {
192 "type": [
193 "string",
194 "array"
195 ],
196 "items": {
197 "type": "string"
198 }
199 }
200 }
201 },
202 "messages": {
203 "type": ["string", "array"],
204 "description": "Messages to always load",
205 "items": {
206 "type": "string"
207 }
208 },
209 "group": {
210 "type": "string",
211 "description": "Group with which this module should be loaded"
212 },
213 "deprecated": {
214 "type": ["object", "string", "boolean"],
215 "description": "Whether the module is deprecated and usage is discouraged. Either a boolean, or a string or an object with key message can be used to customise deprecation message."
216 },
217 "position": {
218 "type": "string",
219 "description": "Position on the page to load this module at",
220 "enum": [
221 "bottom",
222 "top"
223 ]
224 },
225 "templates": {
226 "type": ["object", "array"],
227 "description": "Templates to be loaded for client-side usage"
228 },
229 "targets": {
230 "type": ["string", "array"],
231 "description": "ResourceLoader target the module can run on",
232 "items": {
233 "type": "string"
234 }
235 },
236 "noflip": {
237 "type": "boolean",
238 "description": "Whether to skip CSSJanus LTR-to-RTL flipping for this module. Recommended for styles imported from libraries that already properly handle their RTL styles. Default is false, meaning CSSJanus will be applied on RTL-mode output."
239 }
240 }
241 },
242 {
243 "description": "A ResourceLoaderWikiModule definition",
244 "additionalProperties": false,
245 "properties": {
246 "class": {
247 "enum": ["ResourceLoaderWikiModule"]
248 },
249 "group": {
250 "type": "string",
251 "description": "Group with which this module should be loaded"
252 },
253 "position": {
254 "type": "string",
255 "description": "Position on the page to load this module at",
256 "enum": [
257 "bottom",
258 "top"
259 ]
260 },
261 "targets": {
262 "type": ["string", "array"],
263 "description": "ResourceLoader target the module can run on",
264 "items": {
265 "type": "string"
266 }
267 },
268 "scripts": {
269 "type": "array",
270 "description": "A list of on-wiki pages containing JavaScript that should be loaded",
271 "items": {
272 "type": "string"
273 }
274 },
275 "styles": {
276 "type": "array",
277 "description": "A list of on-wiki pages containing CSS that should be loaded",
278 "items": {
279 "type": "string"
280 }
281 }
282 }
283 },
284 {
285 "description": "A ResourceLoaderImageModule definition",
286 "additionalProperties": false,
287 "properties": {
288 "class": {
289 "enum": ["ResourceLoaderImageModule"]
290 },
291 "defaultColor": {
292 "type": "string"
293 },
294 "data": {
295 "type": "string"
296 },
297 "prefix": {
298 "type": "string"
299 },
300 "selector": {
301 "type": "string"
302 },
303 "selectorWithoutVariant": {
304 "type": "string"
305 },
306 "selectorWithVariant": {
307 "type": "string"
308 },
309 "useDataURI": {
310 "type": "boolean"
311 },
312 "variants": {
313 "type": "object"
314 },
315 "images": {
316 "type": "object"
317 },
318 "position": {
319 "enum": [
320 "top",
321 "bottom"
322 ]
323 }
324 }
325 },
326 {
327 "description": "An arbitrary ResourceLoaderModule definition by class",
328 "properties": {
329 "class": {
330 "type": "string",
331 "pattern": "^((?!ResourceLoader(File|Image)Module).)*$"
332 }
333 },
334 "required": ["class"]
335 },
336 {
337 "description": "An arbitrary ResourceLoaderModule definition with instantiator",
338 "properties": {
339 "factory": {
340 "type": "string",
341 "description": "A static instantiator function for creating the ResourceLoaderModule object."
342 }
343 },
344 "required": ["factory"]
345 }
346 ]
347 }
348 }
349 },
350 "ResourceModuleSkinStyles": {
351 "type": "object",
352 "description": "ResourceLoader modules for custom skin styles"
353 },
354 "ResourceLoaderSources": {
355 "type": "object",
356 "description": "ResourceLoader sources to register"
357 },
358 "ResourceLoaderLESSVars": {
359 "type": "object",
360 "description": "ResourceLoader LESS variables"
361 },
362 "ConfigRegistry": {
363 "type": "object",
364 "description": "Registry of factory functions to create Config objects"
365 },
366 "SessionProviders": {
367 "type": "object",
368 "description": "Session providers"
369 },
370 "AuthManagerAutoConfig": {
371 "type": "object",
372 "description": "AuthManager auto-configuration",
373 "additionalProperties": false,
374 "properties": {
375 "preauth": {
376 "type": "object",
377 "description": "Pre-authentication providers"
378 },
379 "primaryauth": {
380 "type": "object",
381 "description": "Primary authentication providers"
382 },
383 "secondaryauth": {
384 "type": "object",
385 "description": "Secondary authentication providers"
386 }
387 }
388 },
389 "CentralIdLookupProviders": {
390 "type": "object",
391 "description": "Central ID lookup providers"
392 },
393 "ChangeCredentialsBlacklist": {
394 "type": "object",
395 "description": "AuthenticationRequest classes which can only be used internally for credentials change"
396 },
397 "RemoveCredentialsBlacklist": {
398 "type": "object",
399 "description": "AuthenticationRequest classes which can only be used internally for credentials removal"
400 },
401 "namespaces": {
402 "type": "array",
403 "description": "Method to add extra namespaces",
404 "items": {
405 "type": "object",
406 "properties": {
407 "id": {
408 "type": "integer"
409 },
410 "constant": {
411 "type": "string"
412 },
413 "name": {
414 "type": "string"
415 },
416 "gender": {
417 "type": "object",
418 "properties": {
419 "male": {
420 "type": "string"
421 },
422 "female": {
423 "type": "string"
424 }
425 }
426 },
427 "subpages": {
428 "type": "boolean",
429 "default": false
430 },
431 "content": {
432 "type": "boolean",
433 "default": false
434 },
435 "defaultcontentmodel": {
436 "type": "string"
437 },
438 "protection": {
439 "type": ["string", "array"],
440 "description": "Userright(s) required to edit in this namespace"
441 },
442 "capitallinkoverride": {
443 "type": "boolean",
444 "description": "Set $wgCapitalLinks on a per-namespace basis"
445 },
446 "conditional": {
447 "type": "boolean",
448 "description": "Whether the namespace is conditional upon configuration and should not be registered (requires separate registration via a hook)",
449 "default": false
450 }
451 },
452 "required": ["id", "constant", "name"]
453 }
454 },
455 "TrackingCategories": {
456 "type": "array",
457 "description": "Tracking category message keys",
458 "items": {
459 "type": "string"
460 }
461 },
462 "DefaultUserOptions": {
463 "type": "object",
464 "description": "Default values of user options"
465 },
466 "HiddenPrefs": {
467 "type": "array",
468 "description": "Preferences users cannot set",
469 "items": {
470 "type": "string"
471 }
472 },
473 "GroupPermissions": {
474 "type": "object",
475 "description": "Default permissions to give to user groups",
476 "patternProperties": {
477 "^[a-z]+$": {
478 "type": "object",
479 "patternProperties": {
480 "^[a-z]+$": {
481 "type": "boolean"
482 }
483 }
484 }
485 }
486 },
487 "RevokePermissions": {
488 "type": "object",
489 "description": "Default permissions to revoke from user groups",
490 "patternProperties": {
491 "^[a-z]+$": {
492 "type": "object",
493 "patternProperties": {
494 "^[a-z]+$": {
495 "type": "boolean"
496 }
497 }
498 }
499 }
500 },
501 "GrantPermissions": {
502 "type": "object",
503 "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
504 "patternProperties": {
505 "^[a-z]+$": {
506 "type": "object",
507 "patternProperties": {
508 "^[a-z]+$": {
509 "type": "boolean"
510 }
511 }
512 }
513 }
514 },
515 "GrantPermissionGroups": {
516 "type": "object",
517 "description": "Map of grants to their UI grouping",
518 "patternProperties": {
519 "^[a-z]+$": {
520 "type": "string"
521 }
522 }
523 },
524 "ImplicitGroups": {
525 "type": "array",
526 "description": "Implicit groups"
527 },
528 "GroupsAddToSelf": {
529 "type": "object",
530 "description": "Groups a user can add to themselves"
531 },
532 "GroupsRemoveFromSelf": {
533 "type": "object",
534 "description": "Groups a user can remove from themselves"
535 },
536 "AddGroups": {
537 "type": "object",
538 "description": "Groups a user can add to users"
539 },
540 "RemoveGroups": {
541 "type": "object",
542 "description": "Groups a user can remove from users"
543 },
544 "AvailableRights": {
545 "type": "array",
546 "description": "User rights added by the extension",
547 "items": {
548 "type": "string"
549 }
550 },
551 "ContentHandlers": {
552 "type": "object",
553 "description": "Mapping of model ID to class name",
554 "patternProperties": {
555 "^[A-Za-z]+$": {
556 "type": "string"
557 }
558 }
559 },
560 "RateLimits": {
561 "type": "object",
562 "description": "Rate limits"
563 },
564 "RecentChangesFlags": {
565 "type": "object",
566 "description": "Flags (letter symbols) shown on RecentChanges pages"
567 },
568 "MediaHandlers": {
569 "type": "object",
570 "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
571 },
572 "ExtensionFunctions": {
573 "type": [
574 "array",
575 "string"
576 ],
577 "description": "Function to call after setup has finished",
578 "items": {
579 "type": "string"
580 }
581 },
582 "ExtensionMessagesFiles": {
583 "type": "object",
584 "description": "File paths containing PHP internationalization data"
585 },
586 "MessagesDirs": {
587 "type": "object",
588 "description": "Directory paths containing JSON internationalization data"
589 },
590 "ExtensionEntryPointListFiles": {
591 "type": "object"
592 },
593 "SpecialPages": {
594 "type": "object",
595 "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
596 },
597 "AutoloadNamespaces": {
598 "type": "object",
599 "description": "Mapping of PSR-4 compliant namespace to directory for autoloading",
600 "patternProperties": {
601 "^[A-Za-z0-9\\\\]+\\\\$": {
602 "type": "string"
603 }
604 },
605 "additionalProperties": false
606 },
607 "AutoloadClasses": {
608 "type": "object"
609 },
610 "Hooks": {
611 "type": [ "string", "object" ],
612 "description": "Hooks this extension uses (mapping of hook name to callback)"
613 },
614 "JobClasses": {
615 "type": "object",
616 "description": "Job types this extension implements (mapping of job type to class name or factory function)"
617 },
618 "LogTypes": {
619 "type": "array",
620 "description": "List of new log types this extension uses"
621 },
622 "LogRestrictions": {
623 "type": "object"
624 },
625 "FilterLogTypes": {
626 "type": "object"
627 },
628 "ActionFilteredLogs": {
629 "type": "object",
630 "description": "List of log types which can be filtered by log actions",
631 "patternProperties": {
632 "^[a-z-]+$": {
633 "type": "object",
634 "patternProperties": {
635 "^[a-z-]+$": {
636 "type": "array",
637 "items": {
638 "type": "string"
639 }
640 }
641 }
642 }
643 }
644 },
645 "LogNames": {
646 "type": "object"
647 },
648 "LogHeaders": {
649 "type": "object"
650 },
651 "LogActions": {
652 "type": "object"
653 },
654 "LogActionsHandlers": {
655 "type": "object"
656 },
657 "Actions": {
658 "type": "object"
659 },
660 "APIModules": {
661 "type": "object"
662 },
663 "APIFormatModules": {
664 "type": "object"
665 },
666 "APIMetaModules": {
667 "type": "object"
668 },
669 "APIPropModules": {
670 "type": "object"
671 },
672 "APIListModules": {
673 "type": "object"
674 },
675 "ValidSkinNames": {
676 "type": "object"
677 },
678 "FeedClasses": {
679 "type": "object",
680 "description": "Available feeds objects"
681 },
682 "SkinOOUIThemes": {
683 "type": "object",
684 "description": "Map of skin names to OOUI themes to use. Same format as ResourceLoaderOOUIModule::$builtinSkinThemeMap."
685 },
686 "PasswordPolicy": {
687 "type": "object",
688 "description": "Password policies"
689 },
690 "FileExtensions": {
691 "type": "array",
692 "description": "Preferred file extensions for uploading",
693 "items": {
694 "type": "string"
695 }
696 },
697 "callback": {
698 "type": [
699 "array",
700 "string"
701 ],
702 "description": "A function to be called right after MediaWiki processes this file"
703 },
704 "config_prefix": {
705 "type": "string",
706 "default": "wg",
707 "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
708 },
709 "config": {
710 "type": "object",
711 "description": "Configuration options for this extension",
712 "patternProperties": {
713 "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
714 "type": "object",
715 "properties": {
716 "value": {
717 "required": true
718 },
719 "merge_strategy": {
720 "type": "string",
721 "enum": [
722 "array_merge_recursive",
723 "array_replace_recursive",
724 "array_plus_2d",
725 "array_plus",
726 "array_merge"
727 ],
728 "default": "array_merge"
729 },
730 "path": {
731 "description": "Whether this should be interpreted as a filesystem path, relative to extension directory root",
732 "type": "boolean",
733 "default": false
734 },
735 "description": {
736 "type": ["string", "array"],
737 "description": "A description of the config setting, mostly for documentation/developers"
738 },
739 "decriptionmsg": {
740 "type": "string",
741 "description": "The message key which should be used as a description for this configuration option in a user interface. If empty, description will be used."
742 },
743 "public": {
744 "type": "boolean",
745 "default": false,
746 "description": "Whether this configuration option and its value is allowed to be revealed in public or not."
747 }
748 }
749 }
750 }
751 },
752 "ParserTestFiles": {
753 "type": "array",
754 "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
755 },
756 "ServiceWiringFiles": {
757 "type": "array",
758 "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
759 },
760 "attributes": {
761 "description":"Registration information for other extensions",
762 "type": "object",
763 "patternProperties": {
764 ".*": {
765 "type": "object",
766 "patternProperties": {
767 ".*": {
768 "type": ["array", "object"]
769 }
770 }
771 }
772 }
773 },
774 "load_composer_autoloader": {
775 "type": "boolean",
776 "description": "Load the composer autoloader for this extension, if one is present"
777 }
778 }
779 }