메뉴얼:$wgVersion

From mediawiki.org
This page is a translated version of the page Manual:$wgVersion and the translation is 65% complete.
General Settings: $wgVersion
미디어위키 버전.
이 변수가 소개된 버전:1.2.0
폐지예정이 된 버전:1.35.0 (Gerrit change 481950; git #a5d5ea82)
이 변수가 사라진 버전:계속해서 쓰이고 있음
허용값:(문자열)
기본값:Current MediaWiki version - you shouldn't change this!

설명

미디어위키의 현재 버전 (예를 들면, "1.41.0"). 이 옵션은 지정할 필요가 없습니다. 내부적으로만 이용됩니다.

MW_VERSION

미디어위키 버전:
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.

예시

미디어위키 1.19 이후에 동작되는 새 기능을 구현하면서, 그 이전 버전의 하위 호환을 원한다면, 다음과 같이 구성할 수 있습니다:

$oldVersion = version_compare( $wgVersion, '1.18', '<=' );
if ( $oldVersion ) {
    # 미디어위키 1.18 이전 버전을 위한 코드
} else {
    # 미디어위키 1.19 이후를 위한 코드
}

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.

같이 보기