delete internal files after 24h
This commit is contained in:
parent
5e9a233a0b
commit
596a1efafa
|
@ -167,6 +167,21 @@ class Ldap{
|
|||
$file = @readdir($dir);
|
||||
}
|
||||
@closedir($dir);
|
||||
// clean internal files that are older than 24 hours
|
||||
$tmpDir = dirname(__FILE__) . '/../tmp/internal/';
|
||||
$time = time();
|
||||
$dir = @opendir($tmpDir);
|
||||
$file = @readdir($dir);
|
||||
while ($file) {
|
||||
if ((substr($file, -4) == '.tmp')) {
|
||||
$path = $tmpDir . $file;
|
||||
if ($time - filemtime($path) > (3600 * 24)) {
|
||||
@unlink($path);
|
||||
}
|
||||
}
|
||||
$file = @readdir($dir);
|
||||
}
|
||||
@closedir($dir);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue