Mailer.php
authorAlan Knowles <alan@roojs.com>
Fri, 5 Jun 2015 08:55:44 +0000 (16:55 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 5 Jun 2015 08:55:44 +0000 (16:55 +0800)
Mailer.php

index 8601f71..739c9a3 100644 (file)
@@ -69,6 +69,8 @@ class Pman_Core_Mailer {
     
     var $mail_method = 'SMTP';
     
+    var $cache_images = true;
+    
     function Pman_Core_Mailer($args) {
         foreach($args as $k=>$v) {
             // a bit trusting..
@@ -458,7 +460,10 @@ 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')) {
+        if ($this->cachee_images &&
+                file_exists($cache) &&
+                filemtime($cache) > strtotime('NOW - 1 WEEK')
+            ) {
             $ret =  json_decode(file_get_contents($cache), true);
             $ret['file'] = $cache . '.data';
             return $ret;