19 $aResult = parent::install($aParams);
21 $s = $this->
_readFromUrl(
"http://ws.geonames.org/postalCodeCountryInfo?");
24 db_res (
"TRUNCATE TABLE `ch_zip_countries_geonames`");
26 db_res (
"INSERT INTO `ch_zip_countries_geonames` VALUES ('$sCountry')");
36 return parent::uninstall($aParams);
41 if (!preg_match_all(
'/<countryCode>(.*)<\/countryCode>/',
$s, $m)) {
44 return array_unique($m[1]);
49 if (function_exists(
'curl_init')) {
51 curl_setopt($curl, CURLOPT_URL,
$sUrl);
52 curl_setopt($curl, CURLOPT_RETURNTRANSFER,
true);
53 curl_setopt($curl, CURLOPT_HEADER,
false);
54 $s = curl_exec($curl);