Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -653,7 +653,6 @@ |
654 | 654 | $vers[] = ApiBase :: getBaseVersion(); |
655 | 655 | $vers[] = ApiFormatBase :: getBaseVersion(); |
656 | 656 | $vers[] = ApiQueryBase :: getBaseVersion(); |
657 | | - $vers[] = ApiFormatFeedWrapper :: getVersion(); // not accessible with format=xxx |
658 | 657 | return $vers; |
659 | 658 | } |
660 | 659 | |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -248,15 +248,15 @@ |
249 | 249 | if ($this->getMain()->getShowVersions()) { |
250 | 250 | $versions = $this->getVersion(); |
251 | 251 | $pattern = '/(\$.*) ([0-9a-z_]+\.php) (.*\$)/i'; |
252 | | - $replacement = '\\0' . "\n " . 'http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api/\\2'; |
| 252 | + $callback = array($this, 'makeHelpMsg_callback'); |
253 | 253 | |
254 | 254 | if (is_array($versions)) { |
255 | 255 | foreach ($versions as &$v) |
256 | | - $v = preg_replace($pattern, $replacement, $v); |
| 256 | + $v = preg_replace_callback($pattern, $callback, $v); |
257 | 257 | $versions = implode("\n ", $versions); |
258 | 258 | } |
259 | 259 | else |
260 | | - $versions = preg_replace($pattern, $replacement, $versions); |
| 260 | + $versions = preg_replace_callback($pattern, $callback, $versions); |
261 | 261 | |
262 | 262 | $msg .= "Version:\n $versions\n"; |
263 | 263 | } |
— | — | @@ -336,6 +336,36 @@ |
337 | 337 | } else |
338 | 338 | return false; |
339 | 339 | } |
| 340 | + |
| 341 | + /** |
| 342 | + * Callback for preg_replace_callback() call in makeHelpMsg(). |
| 343 | + * Replaces a source file name with a link to ViewVC |
| 344 | + */ |
| 345 | + public function makeHelpMsg_callback($matches) { |
| 346 | + global $wgAutoloadClasses, $wgAutoloadLocalClasses; |
| 347 | + if(isset($wgAutoloadLocalClasses[get_class($this)])) |
| 348 | + $file = $wgAutoloadLocalClasses[get_class($this)]; |
| 349 | + else if(isset($wgAutoloadClasses[get_class($this)])) |
| 350 | + $file = $wgAutoloadClasses[get_class($this)]; |
| 351 | + |
| 352 | + // Do some guesswork here |
| 353 | + $path = strstr($file, 'includes/api/'); |
| 354 | + if($path === false) |
| 355 | + $path = strstr($file, 'extensions/'); |
| 356 | + else |
| 357 | + $path = 'phase3/' . $path; |
| 358 | + |
| 359 | + // Get the filename from $matches[2] instead of $file |
| 360 | + // If they're not the same file, they're assumed to be in the |
| 361 | + // same directory |
| 362 | + // This is necessary to make stuff like ApiMain::getVersion() |
| 363 | + // returning the version string for ApiBase work |
| 364 | + if($path) |
| 365 | + return "{$matches[0]}\n http://svn.wikimedia.org/" . |
| 366 | + "viewvc/mediawiki/trunk/" . dirname($path) . |
| 367 | + "/{$matches[2]}"; |
| 368 | + return $matches[0]; |
| 369 | + } |
340 | 370 | |
341 | 371 | /** |
342 | 372 | * Returns the description string for this module |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -137,6 +137,7 @@ |
138 | 138 | * (bug 18710) Fixed internal error with empty parameter in action=paraminfo |
139 | 139 | * (bug 18709) Missing descriptions for some parameters in action=paraminfo |
140 | 140 | output |
| 141 | +* (bug 18731) Show correct SVN links for extension modules in api.php?version |
141 | 142 | |
142 | 143 | === Languages updated in 1.16 === |
143 | 144 | |