]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/cache_functions.php
Caching of themes (fully supported) and admin menu (experimental!) now configurable
[mailer.git] / inc / libs / cache_functions.php
index 81b65c436bf598a1d3f6d6c58fcaefb4fd49d84e..44df62bedea920e5cb094042077a2d09bdfc163a 100644 (file)
@@ -52,11 +52,14 @@ class mxchange_cache
 
        // Constructor
        function mxchange_cache($interval, $path, $tested) {
+               // Failed is the default
+               $this->ret = "failed";
+
                // Remember interval in class
-               $this->update_interval=$interval;
+               $this->update_interval = $interval;
 
                // Remeber path
-               $this->cache_path=$path;
+               $this->cache_path = $path;
 
                // Check if path exists
                if ((is_dir($path)) && (!$tested)) {
@@ -72,22 +75,16 @@ class mxchange_cache
                                        UPDATE_CONFIG("cache_tested", 1);
 
                                        // All done!
-                                       return "done";
+                                       $this->ret = "done";
                                } else {
                                        // Stop! Set a .htaccess file first
-                                       $this->ret="htaccess";
-                                       return "htaccess";
+                                       $this->ret = "htaccess";
                                }
                        }
                } elseif ($tested) {
                        // System already tested
-                       $this->ret="done";
-                       return "done";
+                       $this->ret = "done";
                }
-
-               // Something goes wrong here!
-               $this->ret="failed";
-               return "failed";
        }
 
        function cache_file($file, $ignore_ctime=false) {
@@ -390,6 +387,10 @@ class mxchange_cache
                // Return line
                return $line;
        }
+
+       function getStatus () {
+               return $this->ret;
+       }
 }
 //
 ?>