function flashnode_cron in Flash Node 5.2
Same name and namespace in other branches
- 5.6 flashnode.module \flashnode_cron()
- 5.3 flashnode.module \flashnode_cron()
Implements hook_cron (delete old temp files)
File
- ./
flashnode.module, line 118
Code
function flashnode_cron() {
$path = variable_get('flashnode_default_path', 'flash') . '/temp';
$files = file_scan_directory(file_create_path($path), '.*');
foreach ($files as $file => $info) {
if (time() - filemtime($file) > 60 * 60 * 6) {
file_delete($file);
}
}
}