r43825 - Code Review

From MediaWiki.org
Jump to: navigation, search
Repository:MediaWiki
Revision:r43824 | r43825 (on ViewVC) | r43826 >
Date:17:45, 21 November 2008
Author:demon
Status:ok
Tags:
Comment:Revert r43788 and r43788 (adding findBySha1 functionality). Something is breaking here and I don't know what...
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
===================================================================
--- trunk/phase3/includes/filerepo/ForeignAPIRepo.php	(revision 43824)
+++ trunk/phase3/includes/filerepo/ForeignAPIRepo.php	(revision 43825)
@@ -72,8 +72,9 @@
 				array_merge( $query,
 					array(
 						'format' => 'json',
-						'action' => 'query' ) ) );
-
+						'action' => 'query',
+						'prop' => 'imageinfo' ) ) );
+		
 		if( !isset( $this->mQueryCache[$url] ) ) {
 			$key = wfMemcKey( 'ForeignAPIRepo', 'Metadata', md5( $url ) );
 			$data = $wgMemc->get( $key );
@@ -94,24 +95,9 @@
 	function getImageInfo( $title, $time = false ) {
 		return $this->queryImage( array(
 			'titles' => 'Image:' . $title->getText(),
-			'iiprop' => 'timestamp|user|comment|url|size|sha1|metadata|mime',
-			'prop'   => 'imageinfo' ) );
+			'iiprop' => 'timestamp|user|comment|url|size|sha1|metadata|mime' ) );
 	}
 	
-	function findBySha1( $hash ) {
-		$results = $this->fetchImageQuery( array(
-										'aisha1base36' => $hash,
-										'aiprop'       => 'timestamp|user|comment|url|size|sha1|metadata|mime',
-										'list'         => 'allimages', ) );
-		$ret = array();
-		foreach ( $results['query']['allimages'] as $img ) {
-			$ret[] = new ForeignAPIFile( Title::makeTitle( NS_IMAGE, $img['name'] ), $this, $img );
-		}
-		return $ret;
-	}
-	
-	
-	
 	function getThumbUrl( $name, $width=-1, $height=-1 ) {
 		$info = $this->queryImage( array(
 			'titles' => 'Image:' . $name,

Status & tagging log

Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox