r55576 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55575‎ | r55576 | r55577 >
Date:16:16, 25 August 2009
Author:ialex
Status:ok
Tags:
Comment:
svn:eol-style native
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.pg.psql (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/SpecialMergeThread.php (modified) (history)
  • /trunk/extensions/Maps/Geocoders/Maps_GeonamesGeocoder.php (modified) (history)
  • /trunk/extensions/Translate/groups/Okawix/Okawix-dtd.yml (modified) (history)
  • /trunk/extensions/Translate/groups/Okawix/Okawix-properties.yml (modified) (history)
  • /trunk/extensions/Translate/groups/Okawix/README (modified) (history)
  • /trunk/phase3/js2/mwEmbed/example_usage/Player_RelatedVideos.html (modified) (history)
  • /trunk/phase3/skins/vector/cssjanus/COPYING (modified) (history)
  • /trunk/phase3/skins/vector/cssjanus/LICENSE (modified) (history)

Diff [purge]

Property changes on: trunk/phase3/skins/vector/cssjanus/LICENSE
___________________________________________________________________
Name: svn:eol-style
11 + native
Property changes on: trunk/phase3/skins/vector/cssjanus/COPYING
___________________________________________________________________
Name: svn:eol-style
22 + native
Property changes on: trunk/phase3/js2/mwEmbed/example_usage/Player_RelatedVideos.html
___________________________________________________________________
Name: svn:eol-style
33 + native
Property changes on: trunk/extensions/LiquidThreads/pages/SpecialMergeThread.php
___________________________________________________________________
Name: svn:eol-style
44 + native
Index: trunk/extensions/Maps/Geocoders/Maps_GeonamesGeocoder.php
@@ -1,42 +1,42 @@
2 -<?php
3 -
4 -/**
5 - * GeoNames Web Services Documentation: http://www.geonames.org/export/geonames-search.html
6 - *
7 - * @file Maps_GeonamesGeocoder.php
8 - * @ingroup Maps
9 - *
10 - * @author Jeroen De Dauw
11 - * Thanks go to Joel Natividad for pointing me to the GeoNames services.
12 - */
13 -
14 -if( !defined( 'MEDIAWIKI' ) ) {
15 - die( 'Not an entry point.' );
16 -}
17 -
18 -final class MapsGeonamesGeocoder extends MapsBaseGeocoder {
19 -
20 - /**
21 - * @see MapsBaseGeocoder::geocode()
22 - *
23 - * @param string $address
24 - */
25 - public static function geocode($address) {
26 - // Create the request url
27 - $requestURL = "http://ws.geonames.org/search?q=". urlencode($address) ."&maxRows=1&style=SHORT";
28 -
29 - $result = self::GetCurlResponse($requestURL);
30 -
31 - $lon = self::getXmlElementValue($result, "lng");
32 - $lat = self::getXmlElementValue($result, "lat");
33 -
34 - // In case one of the values is not found, return false
35 - if (!$lon || !$lat) return false;
36 -
37 - return array(
38 - 'lat' => $lat,
39 - 'lon' => $lon
40 - );
41 - }
42 -
 2+<?php
 3+
 4+/**
 5+ * GeoNames Web Services Documentation: http://www.geonames.org/export/geonames-search.html
 6+ *
 7+ * @file Maps_GeonamesGeocoder.php
 8+ * @ingroup Maps
 9+ *
 10+ * @author Jeroen De Dauw
 11+ * Thanks go to Joel Natividad for pointing me to the GeoNames services.
 12+ */
 13+
 14+if( !defined( 'MEDIAWIKI' ) ) {
 15+ die( 'Not an entry point.' );
 16+}
 17+
 18+final class MapsGeonamesGeocoder extends MapsBaseGeocoder {
 19+
 20+ /**
 21+ * @see MapsBaseGeocoder::geocode()
 22+ *
 23+ * @param string $address
 24+ */
 25+ public static function geocode($address) {
 26+ // Create the request url
 27+ $requestURL = "http://ws.geonames.org/search?q=". urlencode($address) ."&maxRows=1&style=SHORT";
 28+
 29+ $result = self::GetCurlResponse($requestURL);
 30+
 31+ $lon = self::getXmlElementValue($result, "lng");
 32+ $lat = self::getXmlElementValue($result, "lat");
 33+
 34+ // In case one of the values is not found, return false
 35+ if (!$lon || !$lat) return false;
 36+
 37+ return array(
 38+ 'lat' => $lat,
 39+ 'lon' => $lon
 40+ );
 41+ }
 42+
4343 }
\ No newline at end of file
Property changes on: trunk/extensions/Maps/Geocoders/Maps_GeonamesGeocoder.php
___________________________________________________________________
Name: svn:eol-style
4444 + native
Property changes on: trunk/extensions/CentralNotice/CentralNotice.pg.psql
___________________________________________________________________
Name: svn:eol-style
4545 + native
Property changes on: trunk/extensions/Translate/groups/Okawix/Okawix-dtd.yml
___________________________________________________________________
Name: svn:eol-style
4646 + native
Property changes on: trunk/extensions/Translate/groups/Okawix/Okawix-properties.yml
___________________________________________________________________
Name: svn:eol-style
4747 + native
Property changes on: trunk/extensions/Translate/groups/Okawix/README
___________________________________________________________________
Name: svn:eol-style
4848 + native

Status & tagging log