wrystell

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
in reply to: Deleted cache file restoring itself #14481

wrystell
Member

I view now that the script is incomplete in my post, i paste the complete script here: http://pastebin.com/YD9Ddi4t

bye

in reply to: Deleted cache file restoring itself #14459

wrystell
Member

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

in reply to: Deleted cache file restoring itself #13034

wrystell
Member

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

Viewing 3 posts - 1 through 3 (of 3 total)