function image_cron in Image 5
Same name and namespace in other branches
- 5.2 image.module \image_cron()
- 6 image.module \image_cron()
Implements hook_cron. (deletes old temp images)
File
- ./
image.module, line 287
Code
function image_cron() {
$path = variable_get('image_default_path', 'images') . '/temp';
$files = file_scan_directory(file_create_path($path), '.*');
foreach ($files as $file => $info) {
if (time() - filemtime($file) > 60 * 60 * 6) {
file_delete($file);
}
}
}