Forum Replies Created
I view now that the script is incomplete in my post, i paste the complete script here: http://pastebin.com/YD9Ddi4t
bye
Hi, i’ve solved the problem by myself adding a script in the footer of the skin (before the closure of the tag body).
I paste the code here, maybe this could help someone:
<?php //script svuota cache download manager
function isfile($file){ return preg_match('/^[^.^:^?^\-][^:^?]*\.(?i)' . getexts() . '$/',$file);}
function isfile_b($file){ if (strpos($file,'.zip.') !== false) {return true;} else {return false;}}
function getexts(){ return '(zip)'; }
$tempo= 3600*1; //ore * n ore
$path = $_SERVER['DOCUMENT_ROOT'].'/wp-content/plugins/download-manager/cache';
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
if (isfile($path."/".$file)) {
if(filectime($path."/".$file) < time() - $tempo){
unlink($path."/".$file);
}
}
else if (isfile_b($path.$file)) {
if(filectime($path."/".$file)
This script clean the zip files of the cache folder 1 hour older. The time can be setted in seconds in the variable $tempo
Hi, i’m iterested too to the cache auto-management, cause a site of my customer have reached 750GB of cache and the host service want an extra fee of 100$. Now i’ve cleared the cache manually, but if is possible i need an auto-cleaning of the cache folder.
Thanks