From: Chad Horohoe Date: Fri, 21 Nov 2008 17:45:57 +0000 (+0000) Subject: Revert r43788 and r43788 (adding findBySha1 functionality). Something is breaking... X-Git-Tag: 1.31.0-rc.0~44229 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=742c0d61d6cdd11d97c39cd3eb924c9871f824b7;p=lhc%2Fweb%2Fwiklou.git Revert r43788 and r43788 (adding findBySha1 functionality). Something is breaking here and I don't know what... --- diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 08d2d45149..a6773e11ec 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -72,8 +72,9 @@ class ForeignAPIRepo extends FileRepo { 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 @@ class ForeignAPIRepo extends FileRepo { 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,