Manual:Wg variable/fr

wg fait référence à un élément de programmation non constant important utilisé dans le logiciel MediaWiki, et est l'abréviation de Wikipedia Global (le nom est antérieur à la diffusion de MediaWiki au-delà de [[w:Wikipedia|Wikipedia] ]).

In general, any global variable (variable that has global scope) within the software has this prefix to make it easily identifiable when programming. However, a casual hacker will mainly come across such variables in the files  and , which define variables to control the behavior of the software in various ways.

The  file stores the defaults for these values and should not be edited; the   file is used to override these values for a specific site &mdash; if a particular variable is not mentioned in your   file, copy the entry from   and amend as appropriate.

Confusingly, MediaWiki code (mainly in ) and extensions set a different (though overlapping) set of configuration variables in browser JavaScript, and many of these variables also have a wg prefix (without PHP's   sign). See Manual:Interface/JavaScript for a list.

Starting with the introduction of the class in MediaWiki 1.23, the "wg" prefix for PHP global variables is being phased out as configuration settings are moving away from global scope.

Voir aussi

 * Manual:Coding conventions/PHP#Variables for other variable prefixes used in MediaWiki.
 * contains a list of all customization settings defined as global variables in MediaWiki. These can be configured in.
 * - lists some of the main global variables that aren't customization settings.