r108054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108053‎ | r108054 | r108055 >
Date:17:19, 4 January 2012
Author:maxsem
Status:ok
Tags:
Comment:
Follow-up r108052: fixed undefined property warnings, keywords
Modified paths:
  • /trunk/extensions/GeoData/ApiQueryGeoSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GeoData/ApiQueryGeoSearch.php
@@ -60,9 +60,15 @@
6161
6262 $dbr = wfGetDB( DB_SLAVE );
6363 $this->addTables( array( 'geo_tags', 'page' ) );
64 - $this->addFields( array( 'page_namespace', 'page_title', 'gt_lat', 'gt_lon',
 64+ $this->addFields( array( 'gt_lat', 'gt_lon',
6565 "{$dbr->tablePrefix()}gd_distance( {$lat}, {$lon}, gt_lat, gt_lon ) AS dist" )
6666 );
 67+ // retrieve some fields only if page set needs them
 68+ if ( is_null( $resultPageSet ) ) {
 69+ $this->addFields( 'page_id', 'page_namespace', 'page_title' );
 70+ } else {
 71+ $this->addFields( array( "{$dbr->tableName( 'page' )}.*" ) );
 72+ }
6773 $this->addWhereRange( 'gt_lat', 'newer', $rect["minLat"], $rect["maxLat"], false );
6874 $this->addWhereRange( 'gt_lon', 'newer', $rect["minLon"], $rect["maxLon"], false );
6975 //$this->addWhere( 'dist < ' . intval( $radius ) ); hasta be in HAVING, not WHERE
@@ -165,6 +171,6 @@
166172 }
167173
168174 public function getVersion() {
169 - return __CLASS__ . ': $Id: ApiQueryGeoSearch.php 106945 2011-12-21 15:00:59Z maxsem $';
 175+ return __CLASS__ . ': $Id$';
170176 }
171177 }
Property changes on: trunk/extensions/GeoData/ApiQueryGeoSearch.php
___________________________________________________________________
Added: svn:keywords
172178 + Id

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108052API module to search pages by coordinatemaxsem17:01, 4 January 2012

Status & tagging log