Mailer.php
authorEdward <edward@roojs.com>
Mon, 15 Dec 2014 08:50:09 +0000 (16:50 +0800)
committerEdward <edward@roojs.com>
Mon, 15 Dec 2014 08:50:09 +0000 (16:50 +0800)
Mailer.php

index cd134d3..8601f71 100644 (file)
@@ -458,21 +458,18 @@ class Pman_Core_Mailer {
         $user = $uinfo['name']; 
         
         $cache = ini_get('session.save_path')."/Pman_Core_Mailer-{$user}/" . md5($url);
-//        if (file_exists($cache) and filemtime($cache) > strtotime('NOW - 1 WEEK')) {
-//            $ret =  json_decode(file_get_contents($cache), true);
-//            $ret['file'] = $cache . '.data';
-//            return $ret;
-//        }
+        if (file_exists($cache) and filemtime($cache) > strtotime('NOW - 1 WEEK')) {
+            $ret =  json_decode(file_get_contents($cache), true);
+            $ret['file'] = $cache . '.data';
+            return $ret;
+        }
         if (!file_exists(dirname($cache))) {
             mkdir(dirname($cache),0700, true);
         }
-        print_R($url);
-        echo "\n";
+        
         require_once 'HTTP/Request.php';
         $a = new HTTP_Request($url);
         $a->sendRequest();
-        print_R($a->getResponseBody());
-        echo "\n";
         file_put_contents($cache .'.data', $a->getResponseBody());
         
         $mt = $a->getResponseHeader('Content-Type');