Index: branches/5.2.x/units/helpers/ecb_currency_rates.php =================================================================== diff -u -r15141 -r15166 --- branches/5.2.x/units/helpers/ecb_currency_rates.php (.../ecb_currency_rates.php) (revision 15141) +++ branches/5.2.x/units/helpers/ecb_currency_rates.php (.../ecb_currency_rates.php) (revision 15166) @@ -1,56 +1,56 @@ -RateSource = 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml'; - - parent::__construct(); - } - - function GetRatesData() - { - $xml_parser = xml_parser_create(); - - $curl_helper = $this->Application->recallObject('CurlHelper'); - /* @var $curl_helper kCurlHelper */ - - $xml = $curl_helper->Send($this->RateSource); - - xml_parse_into_struct($xml_parser, $xml, $struct, $index); - $data_res = Array(); - foreach($struct as $element) - { - if(isset($element['attributes']) && isset($element['attributes']['CURRENCY'])) - { - $currency = $element['attributes']['CURRENCY']; - $data_res[$currency]['ID'] = $currency; - $data_res[$currency]['TARGET'] = 'EUR'; - $data_res[$currency]['UNITS'] = 1; - $data_res[$currency]['RATE'] = ($element['attributes']['RATE'] == 0) ? 0 : 1 / $element['attributes']['RATE']; - } - } - if(!$data_res['EUR']) - { - $data_res['EUR']['ID'] = 'EUR'; - $data_res['EUR']['UNITS'] = 1; - $data_res['EUR']['TARGET'] = 'EUR'; - $data_res['EUR']['RATE'] = 1; - } - $this->ExchangeRates = $data_res; - } -} +RateSource = 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml'; + + parent::__construct(); + } + + function GetRatesData() + { + $xml_parser = xml_parser_create(); + + $curl_helper = $this->Application->recallObject('CurlHelper'); + /* @var $curl_helper kCurlHelper */ + + $xml = $curl_helper->Send($this->RateSource); + + xml_parse_into_struct($xml_parser, $xml, $struct, $index); + $data_res = Array(); + foreach($struct as $element) + { + if(isset($element['attributes']) && isset($element['attributes']['CURRENCY'])) + { + $currency = $element['attributes']['CURRENCY']; + $data_res[$currency]['ID'] = $currency; + $data_res[$currency]['TARGET'] = 'EUR'; + $data_res[$currency]['UNITS'] = 1; + $data_res[$currency]['RATE'] = ($element['attributes']['RATE'] == 0) ? 0 : 1 / $element['attributes']['RATE']; + } + } + if(!$data_res['EUR']) + { + $data_res['EUR']['ID'] = 'EUR'; + $data_res['EUR']['UNITS'] = 1; + $data_res['EUR']['TARGET'] = 'EUR'; + $data_res['EUR']['RATE'] = 1; + } + $this->ExchangeRates = $data_res; + } +}