fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [6756] API: clear cache for old files for js-combine


From: Sigurd Nes
Subject: [Fmsystem-commits] [6756] API: clear cache for old files for js-combine
Date: Wed, 12 Jan 2011 12:46:42 +0000

Revision: 6756
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6756
Author:   sigurdne
Date:     2011-01-12 12:46:41 +0000 (Wed, 12 Jan 2011)
Log Message:
-----------
API: clear cache for old files for js-combine

Modified Paths:
--------------
    trunk/phpgwapi/inc/combine.php

Modified: trunk/phpgwapi/inc/combine.php
===================================================================
--- trunk/phpgwapi/inc/combine.php      2011-01-12 12:46:05 UTC (rev 6755)
+++ trunk/phpgwapi/inc/combine.php      2011-01-12 12:46:41 UTC (rev 6756)
@@ -162,6 +162,20 @@
                        {
                                fwrite($fp, $contents);
                                fclose($fp);
+
+                               /**
+                                * Remove files that are older than a day
+                                */
+                               $min_ctime = time() - (60*60*24);
+                               $dir = new DirectoryIterator($cachedir);
+                               foreach ( $dir as $fileinfo )
+                               {
+                                       if ( preg_match('/^cache-/', 
$fileinfo->getFilename())
+                                               && $fileinfo->getCTime() < 
$min_ctime )
+                                       {
+                                               
unlink($fileinfo->getPathname());
+                                       }
+                               }
                        }
                }
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]