From: Alan Knowles Date: Mon, 5 Oct 2015 07:24:21 +0000 (+0800) Subject: DataObjects/Core_curr_rate.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=6b00625ad91ccd4de45add0adbe9a3e9c8e64a03 DataObjects/Core_curr_rate.php --- diff --git a/DataObjects/Core_curr_rate.php b/DataObjects/Core_curr_rate.php index f274fac3..99a06e4e 100644 --- a/DataObjects/Core_curr_rate.php +++ b/DataObjects/Core_curr_rate.php @@ -63,26 +63,25 @@ class Pman_Core_DataObjects_Core_curr_rate extends DB_DataObject // now try loading from latest.. - $target = ini_get('session.save_path').'/eurofxref-daily.xml'; - - if (!file_exists($target) || filemtime($target) < (time() - 60*60*24)) { - // this may fail... - $f = @file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); - if (!strlen($f)) { - return; - } - - - } - $dom = simplexml_load_file($target); - $rates['EUR'] = 1.0; - $rates['TWD'] = 46.7008412; - $rates['VND'] = 26405.3; - foreach($dom->Cube->Cube->Cube as $c) { - //echo '
';print_r($c );
-            $rates[(string)$c['currency']] = (string)$c['rate'];
+             // this may fail...
+        $f = @file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
+        if (strlen($f)) {
+            
+            $dom = simplexml_load_file($target);
+            $rates['EUR'] = 1.0;
+            $rates['TWD'] = 46.7008412;
+            $rates['VND'] = 26405.3;
+           
+            foreach($dom->Cube->Cube->Cube as $c) {
+               //echo '
';print_r($c );
+                $rates[(string)$c['currency']] = (string)$c['rate'];
+            }
+            $rates['RMB'] = $rates['CNY'] ;
         }
-        $rates['RMB'] = $rates['CNY'] ;
+        
+        
+        
+        
     }
 }