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