I18n.php
[Pman.Core] / I18n.php
index 6168fb9..9d403d9 100644 (file)
--- a/I18n.php
+++ b/I18n.php
@@ -193,8 +193,8 @@ class Pman_Core_I18n extends Pman
             $ar[$lang]['m'] = $i->toTransList('m', $rlang);
         }
         //echo '<PRE>';print_r($ar);
-//        header('Content-type: text/javascript');
-//        echo 'Pman.I18n.Data = ' .  json_encode($ar);
+        header('Content-type: text/javascript');
+        echo 'Pman.I18n.Data = ' .  json_encode($ar);
         exit;
         
         
@@ -287,8 +287,11 @@ class Pman_Core_I18n extends Pman
         }
         $target = ini_get('session.save_path').'/eurofxref-daily.xml';
         if (!file_exists($target) || filemtime($target) < (time() - 60*60*24)) {
-            $f = file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
+            // this may fail...
+            $f = @file_get_contents('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
             if (!strlen($f)) {
+                $target = dirname(__FILE__).'eurofxref-daily.xml';
+                
                 return false;
             }
             file_put_contents($target,$f);