Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/helpers/bank_lv_currency_rates.php
Show All 22 Lines | |||||
} | } | ||||
function GetRatesData() | function GetRatesData() | ||||
{ | { | ||||
$xml_parser = xml_parser_create(); | $xml_parser = xml_parser_create(); | ||||
/** @var kCurlHelper $curl_helper */ | /** @var kCurlHelper $curl_helper */ | ||||
$curl_helper = $this->Application->recallObject('CurlHelper'); | $curl_helper = $this->Application->recallObject('CurlHelper'); | ||||
$curl_helper->followLocation = true; | |||||
$xml = $curl_helper->Send($this->RateSource); | $xml = $curl_helper->Send($this->RateSource); | ||||
if ( !$curl_helper->isGoodResponseCode() || strlen($xml) == 0 ) { | |||||
return; | |||||
} | |||||
xml_parse_into_struct($xml_parser, $xml, $struct, $index); | xml_parse_into_struct($xml_parser, $xml, $struct, $index); | ||||
$data_res = Array(); | $data_res = Array(); | ||||
$currency = ''; | $currency = ''; | ||||
foreach($struct as $element) | foreach($struct as $element) | ||||
{ | { | ||||
switch($element['tag']) | switch($element['tag']) | ||||
{ | { | ||||
case 'ID': | case 'ID': | ||||
Show All 24 Lines |