r15511 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r15510‎ | r15511 | r15512 >
Date:19:49, 10 July 2006
Author:hashar
Status:old
Tags:
Comment:
Fix #6622: image::newFromTitle deprecated but still used
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)
  • /trunk/phase3/includes/ExternalEdit.php (modified) (history)
  • /trunk/phase3/includes/Image.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/includes/SpecialNewimages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -124,11 +124,13 @@
125125 array_push( $children_start_char, $wgContLang->convert( $sortkey ) ) ;
126126 } elseif( $showGallery && $title->getNamespace() == NS_IMAGE ) {
127127 // Show thumbnails of categorized images, in a separate chunk
 128+ $anImage = new Image($title);
128129 if( $flip ) {
129 - $ig->insert( Image::newFromTitle( $title ) );
 130+ $ig->insert( $anImage );
130131 } else {
131 - $ig->add( Image::newFromTitle( $title ) );
 132+ $ig->add( $anImage );
132133 }
 134+ unset($anImage);
133135 } else {
134136 // Page in this category
135137 array_push( $articles, $sk->makeSizeLinkObj( $x->page_len, $title, $wgContLang->convert( $title->getPrefixedText() ) ) ) ;
Index: trunk/phase3/includes/ExternalEdit.php
@@ -48,7 +48,7 @@
4949 $extension="wiki";
5050 } elseif($this->mMode=="file") {
5151 $type="Edit file";
52 - $image = Image::newFromTitle( $this->mTitle );
 52+ $image = new Image( $this->mTitle );
5353 $img_url = $image->getURL();
5454 if(strpos($img_url,"://")) {
5555 $url = $img_url;
Index: trunk/phase3/includes/Parser.php
@@ -1634,7 +1634,7 @@
16351635 $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix );
16361636 continue;
16371637 } elseif( $ns == NS_IMAGE ) {
1638 - $img = Image::newFromTitle( $nt );
 1638+ $img = new Image( $nt );
16391639 if( $img->exists() ) {
16401640 // Force a blue link if the file exists; may be a remote
16411641 // upload on the shared repository, and we want to see its
Index: trunk/phase3/includes/SpecialNewimages.php
@@ -130,7 +130,7 @@
131131 $ut = $s->img_user_text;
132132
133133 $nt = Title::newFromText( $name, NS_IMAGE );
134 - $img = Image::newFromTitle( $nt );
 134+ $img = new Image( $nt );
135135 $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
136136
137137 $gallery->add( $img, "$ul<br />\n<i>".$wgLang->timeanddate( $s->img_timestamp, true )."</i><br />\n" );
Index: trunk/phase3/includes/Image.php
@@ -66,14 +66,6 @@
6767 }
6868 }
6969
70 - /**
71 - * Obsolete factory function, use constructor
72 - * @deprecated
73 - */
74 - function newFromTitle( $title ) {
75 - return new Image( $title );
76 - }
77 -
7870 function Image( $title ) {
7971 if( !is_object( $title ) ) {
8072 throw new MWException( 'Image constructor given bogus title.' );
Index: trunk/phase3/RELEASE-NOTES
@@ -47,6 +47,7 @@
4848 cache object.
4949 * (bug 6299) Maintain parser's revision ID across recursive calls to fix
5050 {{REVISIONID}} when Cite extension is used
 51+* (bug 6622) Removed deprecated function image::newFromTitle
5152
5253
5354 == Languages updated ==