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