r78680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78679‎ | r78680 | r78681 >
Date:15:28, 21 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Migrate getSql to getQueryInfo
Modified paths:
  • /branches/querypage-work2/phase3/includes/specials/SpecialFileDuplicateSearch.php (modified) (history)

Diff [purge]

Index: branches/querypage-work2/phase3/includes/specials/SpecialFileDuplicateSearch.php
@@ -44,19 +44,18 @@
4545 return array( 'filename' => $this->filename );
4646 }
4747
48 - function getSQL() {
49 - $dbr = wfGetDB( DB_SLAVE );
50 - $image = $dbr->tableName( 'image' );
51 - $hash = $dbr->addQuotes( $this->hash );
52 -
53 - return "SELECT 'FileDuplicateSearch' AS type,
54 - img_name AS title,
55 - img_sha1 AS value,
56 - img_user_text,
57 - img_timestamp
58 - FROM $image
59 - WHERE img_sha1 = $hash
60 - ";
 48+ function getQueryInfo() {
 49+ return array(
 50+ 'tables' => array( 'image' ),
 51+ 'fields' => array(
 52+ "'FileDuplicateSearch' AS type",
 53+ 'img_name AS title',
 54+ 'img_sha1 AS value',
 55+ 'img_user_text',
 56+ 'img_timestamp'
 57+ ),
 58+ 'conds' => array( 'img_sha1' => $this->hash )
 59+ );
6160 }
6261
6362 function formatResult( $skin, $result ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r78681Minor followup to r78680, drop obsolete typereedy15:30, 21 December 2010

Status & tagging log