]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/cache_functions.php
- Daily/weekly/monthly reset completely rewritten
[mailer.git] / inc / libs / cache_functions.php
index 2e42b1dd9537a8e8b94efbeb0cd33422213e0659..619579d5377425ef1ff8926e807723d9098a12ed 100644 (file)
@@ -61,31 +61,24 @@ class mxchange_cache
                {
                        // Check if we can create a file inside the path
                        @touch($path."dummy.tmp", 'w');
-                       if (file_exists($path."dummy.tmp"))
-                       {
+                       if (file_exists($path."dummy.tmp")) {
                                // Yes, we can do. So let's remove it
-                               unlink($path."dummy.tmp");
+                               @unlink($path."dummy.tmp");
 
                                // Is there a .htaccess file?
-                               if (file_exists($path.".htaccess"))
-                               {
+                               if (file_exists($path.".htaccess")) {
                                        // Update database that we have tested it
-                                       $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_config SET cache_tested='1' WHERE config=0 LIMIT 1", __FILE__, __LINE__);
-                                       $this->ret="done";
+                                       UPDATE_CONFIG("cache_tested", 1);
 
                                        // All done!
                                        return "done";
-                               }
-                               else
-                               {
+                               } else {
                                        // Stop! Set a .htaccess file first
                                        $this->ret="htaccess";
                                        return "htaccess";
                                }
                        }
-               }
-               elseif ($tested)
-               {
+               } elseif ($tested) {
                        // System already tested
                        $this->ret="done";
                        return "done";
@@ -268,13 +261,13 @@ class mxchange_cache
                                                foreach($v as $k2=>$v2)
                                                {
                                                        // Put every array element in a row...
-                                                       $LINE .= "\$cacheInstance['".$k."'][] = \"".$v2."\";\n";
+                                                       $LINE .= "\$data['".$k."'][] = \"".$v2."\";\n";
                                                }
                                        }
                                        else
                                        {
                                                // Single line found
-                                               $LINE = "\$cacheInstance['".$k."'] = \"".$v."\";\n";
+                                               $LINE = "\$data['".$k."'] = \"".$v."\";\n";
                                        }
 
                                        // Write line(s)
@@ -331,13 +324,13 @@ class mxchange_cache
                                                        foreach($v as $k2=>$v2)
                                                        {
                                                                // Put every array element in a row...
-                                                               $LINE .= "\$cacheInstance['".$k."'][] = \"".$v2."\";\n";
+                                                               $LINE .= "\$data['".$k."'][] = \"".$v2."\";\n";
                                                        }
                                                }
                                                else
                                                {
                                                        // Single line found
-                                                       $LINE = "\$cacheInstance['".$k."'] = \"".$v."\";\n";
+                                                       $LINE = "\$data['".$k."'] = \"".$v."\";\n";
                                                }
 
                                                // Write line(s)