Mailer.php
authorAlan Knowles <alan@roojs.com>
Wed, 22 Aug 2012 03:45:36 +0000 (11:45 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 22 Aug 2012 03:45:36 +0000 (11:45 +0800)
Mailer.php

index 55ff7ac..50abc39 100644 (file)
@@ -171,7 +171,12 @@ class Pman_Core_Mailer {
         // CACHE???
         // 2 files --- the info file.. and the actual file...
         $cache = ini_get('session.save_path').'/Pman_Core_Mailer/' . md5($url);
-        
+        if (file_exists($cache) and filemtime($cache) > strtotime('NOW - 1 WEEK')) {
+            return json_decode($cache);
+        }
+        if (!file_exists(dirname($cache))) {
+            mkdir(dirname($cache),0666, true);
+        }
         
         $a = &new HTTP_Request($url);
         $a->sendRequest();