Changeset 7017
- Timestamp:
- 01/12/08 00:20:12 (5 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfGeocoderPlugin/lib/sfGeocoderCache.class.php
r4222 r7017 11 11 $this->setCacheDir(sfConfig::get('sf_geocoder_cache_dir', sfConfig::get('sf_cache_dir') . '/geocoder')); 12 12 } 13 13 14 public function getShortString() 14 15 { … … 81 82 $this->set($id, '', serialize($result)); 82 83 } 84 83 85 $this->result = $result; 84 86 return $result; … … 115 117 $q['city'] = $c; 116 118 } 117 118 119 return $q; 119 120 } … … 126 127 // country=$c&state=$s&city=$c&zip=$z 127 128 128 129 129 $q = $this->getCSZAsArray(array('convert_spaces'=>true)); 130 130 plugins/sfGeocoderPlugin/lib/sfGoogleMapsGeocoder.class.php
r4222 r7017 37 37 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 38 38 $response = curl_exec($curl); 39 40 39 // convert response to result 41 40 $result = array(); … … 43 42 $xml = new SimpleXMLElement(utf8_encode ($response)); 44 43 45 $country = $xml->Response->Placemark->AddressDetails->Country; 46 $state = $country->AdministrativeArea; 47 $city = $state->SubAdministrativeArea->Locality; 48 // var_dump($url); 49 // exit; 44 $country = $xml->Response->Placemark->AddressDetails->Country; 45 $state = $country->AdministrativeArea; 46 $city = $state->Locality; 47 50 48 $result['country'] = (String) $country->CountryNameCode; 51 49 $result['state'] = (String) $state->AdministrativeAreaName;