Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -1330,6 +1330,7 @@ |
1331 | 1331 | /** |
1332 | 1332 | * Wrapper for wfFindFile(), for backwards-compatibility only |
1333 | 1333 | * Do not use in core code. |
| 1334 | + * @deprecated |
1334 | 1335 | */ |
1335 | 1336 | function newFromTitle( $title, $time = false ) { |
1336 | 1337 | $img = wfFindFile( $title, $time ); |
— | — | @@ -1338,6 +1339,29 @@ |
1339 | 1340 | } |
1340 | 1341 | return $img; |
1341 | 1342 | } |
| 1343 | + |
| 1344 | + /** |
| 1345 | + * Return the URL of an image, provided its name. |
| 1346 | + * |
| 1347 | + * Backwards-compatibility for extensions. |
| 1348 | + * Note that fromSharedDirectory will only use the shared path for files |
| 1349 | + * that actually exist there now, and will return local paths otherwise. |
| 1350 | + * |
| 1351 | + * @param string $name Name of the image, without the leading "Image:" |
| 1352 | + * @param boolean $fromSharedDirectory Should this be in $wgSharedUploadPath? |
| 1353 | + * @return string URL of $name image |
| 1354 | + * @deprecated |
| 1355 | + */ |
| 1356 | + static function imageUrl( $name, $fromSharedDirectory = false ) { |
| 1357 | + $image = null; |
| 1358 | + if( $fromSharedDirectory ) { |
| 1359 | + $image = wfFindFile( $name ); |
| 1360 | + } |
| 1361 | + if( !$image ) { |
| 1362 | + $image = wfLocalFile( $name ); |
| 1363 | + } |
| 1364 | + return $image->getUrl(); |
| 1365 | + } |
1342 | 1366 | } |
1343 | 1367 | |
1344 | 1368 | /** |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -108,6 +108,7 @@ |
109 | 109 | * Add Google Wireless Transcoder to the Unicode editing blacklist |
110 | 110 | * (bug 10083) Fix for Special:Version breakage on PHP 5.2 with some hooks |
111 | 111 | * (bug 3624) TeX: \ker, \hom, \arg, \dim treated like \sin & \cos |
| 112 | +* (bug 10132, 10134) Restore back-compatibility Image::imageUrl() function |
112 | 113 | |
113 | 114 | |
114 | 115 | == MediaWiki API changes since 1.10 == |