* Include SVN revision number in {{CURRENTVERSION}} output, where applicable
authorRob Church <robchurch@users.mediawiki.org>
Wed, 30 Aug 2006 08:03:10 +0000 (08:03 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 30 Aug 2006 08:03:10 +0000 (08:03 +0000)
* Make the MediaWiki version-reading functions in SpecialVersion.php static

RELEASE-NOTES
includes/Parser.php
includes/SpecialVersion.php

index ef7da1e..c42f92b 100644 (file)
@@ -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 ==
 
index fedbeab..d217f1e 100644 (file)
@@ -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':
index 8ad14ce..da654e6 100644 (file)
@@ -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;