Manuel:$wgVersion
![]() | Cette fonctionnalité obsolète ne devrait plus être utilisée, mais est encore disponible pour des raisons de compatibilité avec l'existant. Cette fonctionnalité est obsolète depuis la version 1.35.0. |
Paramètres généraux: $wgVersion | |
---|---|
Numéro de version de MediaWiki. |
|
Introduit dans la version : | 1.2.0 |
Obsolète dans la version : | 1.35.0 (Gerrit change 481950; git #a5d5ea82) |
Retiré dans la version : | Encore utilisé |
Valeurs autorisées : | (chaîne) |
Valeur par défaut : | Version actuelle de MediaWiki - vous ne devriez pas le modifier! |
Autres paramètres : Alphabétique | Par Fonction |
Détails
La version actuelle de MediaWiki (par ex., "1.35.1"). Vous ne devriez pas avoir besoin de fixer cette variable; elle est utilisée en interne.
MW_VERSION
Version de MediaWiki : | ≥ 1.35 |
Starting with MediaWiki 1.35, $wgVersion
is deprecated, and replaced with the MW_VERSION
constant.
It is also available in MediaWiki 1.31.7, 1.33.3 and 1.34.1, though this should not be relied on as its presence is required for some release tools.
$wgVersion
will continue to function the same as before in those versions.
Exemple de code
If you're implementing a new feature that only works in MediaWiki 1.19 or later, but you want to maintain backwards compatibility, you could use a test such as the following:
$oldVersion = version_compare( $wgVersion, '1.18', '<=' );
if ( $oldVersion ) {
# Do stuff for MediaWiki 1.18 and older
} else {
# Do stuff for MediaWiki 1.19 and newer
}
However, it is typically recommended that you use feature detection to see whether the method or class you wish to use is available instead of depending upon raw version strings.
Voir aussi
- Special:Version – view the version number of a MediaWiki installation (plus much more information) from the web interface.
- Mise à jour
- Version
- MediaWiki configuration settings/fr
- MediaWiki configuration settings 1.2.0/fr
- MediaWiki configuration settings introduced in version 1.2.0/fr
- MediaWiki configuration settings deprecated in version 1.35.0/fr
- MediaWiki configuration settings still in use/fr
- MediaWiki deprecated or obsolete features/fr
- Variables/fr