r16280 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16279‎ | r16280 | r16281 >
Date:08:03, 30 August 2006
Author:robchurch
Status:old
Tags:
Comment:
* Include SVN revision number in {{CURRENTVERSION}} output, where applicable
* Make the MediaWiki version-reading functions in SpecialVersion.php static
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/includes/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES
@@ -163,6 +163,7 @@
164164 * (bug 7109) Fix Atom feed version number in header links
165165 * (bug 7075) List registered parser function hooks on Special:Version
166166 * (bug 7059) Introduce "anchorencode" colon function
 167+* Include SVN revision number in {{CURRENTVERSION}} output, where applicable
167168
168169 == Languages updated ==
169170
Index: trunk/phase3/includes/Parser.php
@@ -2474,8 +2474,9 @@
24752475 case 'localtimestamp':
24762476 return $varCache[$index] = $localTimestamp;
24772477 case 'currentversion':
2478 - global $wgVersion;
2479 - return $wgVersion;
 2478+ return $varCache[$index] = SpecialVersion::getVersion();
 2479+ #global $wgVersion;
 2480+ #return $wgVersion;
24802481 case 'sitename':
24812482 return $wgSitename;
24822483 case 'server':
Index: trunk/phase3/includes/SpecialVersion.php
@@ -45,7 +45,7 @@
4646 * @static
4747 */
4848 function MediaWikiCredits() {
49 - $version = $this->getVersion();
 49+ $version = self::getVersion();
5050 $dbr =& wfGetDB( DB_SLAVE );
5151
5252 $ret =
@@ -77,9 +77,9 @@
7878 return str_replace( "\t\t", '', $ret );
7979 }
8080
81 - function getVersion() {
 81+ public static function getVersion() {
8282 global $wgVersion, $IP;
83 - $svn = $this->getSvnRevision( $IP );
 83+ $svn = self::getSvnRevision( $IP );
8484 return $svn ? "$wgVersion (r$svn)" : $wgVersion;
8585 }
8686
@@ -241,7 +241,7 @@
242242 * @param string $dir
243243 * @return mixed revision number as int, or false if not a SVN checkout
244244 */
245 - function getSvnRevision( $dir ) {
 245+ public static function getSvnRevision( $dir ) {
246246 if( !function_exists( 'simplexml_load_file' ) ) {
247247 // We could fall back to expat... YUCK
248248 return false;