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