r22703 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22702‎ | r22703 | r22704 >
Date:15:22, 4 June 2007
Author:brion
Status:old
Tags:
Comment:
* (bug 10132, 10134) Restore back-compatibility Image::imageUrl() function
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -1330,6 +1330,7 @@
13311331 /**
13321332 * Wrapper for wfFindFile(), for backwards-compatibility only
13331333 * Do not use in core code.
 1334+ * @deprecated
13341335 */
13351336 function newFromTitle( $title, $time = false ) {
13361337 $img = wfFindFile( $title, $time );
@@ -1338,6 +1339,29 @@
13391340 }
13401341 return $img;
13411342 }
 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+ }
13421366 }
13431367
13441368 /**
Index: trunk/phase3/RELEASE-NOTES
@@ -108,6 +108,7 @@
109109 * Add Google Wireless Transcoder to the Unicode editing blacklist
110110 * (bug 10083) Fix for Special:Version breakage on PHP 5.2 with some hooks
111111 * (bug 3624) TeX: \ker, \hom, \arg, \dim treated like \sin & \cos
 112+* (bug 10132, 10134) Restore back-compatibility Image::imageUrl() function
112113
113114
114115 == MediaWiki API changes since 1.10 ==

Follow-up revisions

RevisionCommit summaryAuthorDate
r22717Merged revisions 22667-22715 via svnmerge from...david20:00, 4 June 2007

Status & tagging log