Initial commit
This commit is contained in:
18
src-backup/qr/cleanup_qrcodes.php
Normal file
18
src-backup/qr/cleanup_qrcodes.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
// cleanup_qrcodes.php
|
||||
$temp_dir = '../temp_qrcodes/';
|
||||
|
||||
if (file_exists($temp_dir)) {
|
||||
$files = glob($temp_dir . '*.png');
|
||||
$now = time();
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (is_file($file)) {
|
||||
// Delete files older than 1 hour
|
||||
if ($now - filemtime($file) >= 3600) {
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user