From: Rob Church Date: Wed, 30 Aug 2006 08:03:10 +0000 (+0000) Subject: * Include SVN revision number in {{CURRENTVERSION}} output, where applicable X-Git-Tag: 1.31.0-rc.0~55879 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=930ddce13a553b7e1e924f806075563577d6f1be;p=lhc%2Fweb%2Fwiklou.git * Include SVN revision number in {{CURRENTVERSION}} output, where applicable * Make the MediaWiki version-reading functions in SpecialVersion.php static --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ef7da1e778..c42f92bcea 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -163,6 +163,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 7109) Fix Atom feed version number in header links * (bug 7075) List registered parser function hooks on Special:Version * (bug 7059) Introduce "anchorencode" colon function +* Include SVN revision number in {{CURRENTVERSION}} output, where applicable == Languages updated == diff --git a/includes/Parser.php b/includes/Parser.php index fedbeab1b6..d217f1ee36 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2474,8 +2474,9 @@ class Parser case 'localtimestamp': return $varCache[$index] = $localTimestamp; case 'currentversion': - global $wgVersion; - return $wgVersion; + return $varCache[$index] = SpecialVersion::getVersion(); + #global $wgVersion; + #return $wgVersion; case 'sitename': return $wgSitename; case 'server': diff --git a/includes/SpecialVersion.php b/includes/SpecialVersion.php index 8ad14ce1ba..da654e6ec6 100644 --- a/includes/SpecialVersion.php +++ b/includes/SpecialVersion.php @@ -45,7 +45,7 @@ class SpecialVersion { * @static */ function MediaWikiCredits() { - $version = $this->getVersion(); + $version = self::getVersion(); $dbr =& wfGetDB( DB_SLAVE ); $ret = @@ -77,9 +77,9 @@ class SpecialVersion { return str_replace( "\t\t", '', $ret ); } - function getVersion() { + public static function getVersion() { global $wgVersion, $IP; - $svn = $this->getSvnRevision( $IP ); + $svn = self::getSvnRevision( $IP ); return $svn ? "$wgVersion (r$svn)" : $wgVersion; } @@ -241,7 +241,7 @@ class SpecialVersion { * @param string $dir * @return mixed revision number as int, or false if not a SVN checkout */ - function getSvnRevision( $dir ) { + public static function getSvnRevision( $dir ) { if( !function_exists( 'simplexml_load_file' ) ) { // We could fall back to expat... YUCK return false;