Code

Do not remove transmitted stat files
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 Aug 2010 09:19:20 +0000 (09:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 Aug 2010 09:19:20 +0000 (09:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19416 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_stats.inc

index b311baf0f454130e1e34c4240d10e040749ba01c..1523d6d64bc05842710d56e18a0adb60c7b0fb5a 100644 (file)
@@ -100,7 +100,9 @@ class stats
             $path = $config->get_cfg_value('core', 'statsDatabaseDirectory');
             $dir = opendir($path);
             while($file = readdir($dir)){
-                if(is_file($path.'/'.$file)) $res[] = $file;
+                if(is_file($path.'/'.$file) && !preg_match('/.old$/', $file)) {
+                    $res[] = $file;
+                }
             }
         } 
         return($res);   
@@ -326,7 +328,8 @@ class stats
             sqlite_close(stats::$lastHandle[$filename]);
         }
         if(file_exists($path.'/'.$filename)){
-            unlink($path.'/'.$filename);
+            #unlink($path.'/'.$filename);
+            rename($path.'/'.$filename,  $path.'/'.$filename.".old");
         }
     }
 }