r34305 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34304‎ | r34305 | r34306 >
Date:11:54, 6 May 2008
Author:tstarling
Status:old
Tags:
Comment:
Introduce svn-revision in $wgExtensionCredits for fast extension version specification.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -2203,7 +2203,8 @@
22042204 * <code>
22052205 * $wgExtensionCredits[$type][] = array(
22062206 * 'name' => 'Example extension',
2207 - * 'version' => 1.9,
 2207+ * 'version' => 1.9,
 2208+ * 'svn-revision' => '$LastChangedRevision$',
22082209 * 'author' => 'Foo Barstein',
22092210 * 'url' => 'http://wwww.example.com/Example%20Extension/',
22102211 * 'description' => 'An example extension',
Index: trunk/phase3/includes/SpecialVersion.php
@@ -135,9 +135,20 @@
136136 usort( $wgExtensionCredits[$type], array( $this, 'compare' ) );
137137
138138 foreach ( $wgExtensionCredits[$type] as $extension ) {
 139+ if ( isset( $extension['version'] ) ) {
 140+ $version = $extension['version'];
 141+ } elseif ( isset( $extension['svn-revision'] ) &&
 142+ preg_match( '/\$(?:Rev|LastChangedRevision|Revision): *(\d+)/',
 143+ $extension['svn-revision'], $m ) )
 144+ {
 145+ $version = 'r' . $m[1];
 146+ } else {
 147+ $version = null;
 148+ }
 149+
139150 $out .= $this->formatCredits(
140151 isset ( $extension['name'] ) ? $extension['name'] : '',
141 - isset ( $extension['version'] ) ? $extension['version'] : null,
 152+ $version,
142153 isset ( $extension['author'] ) ? $extension['author'] : '',
143154 isset ( $extension['url'] ) ? $extension['url'] : null,
144155 isset ( $extension['description'] ) ? $extension['description'] : '',

Status & tagging log