function video_upload_cron in Video 5
Same name and namespace in other branches
- 6 types/video_upload/video_upload.module \video_upload_cron()
- 6.2 types/video_upload/video_upload.module \video_upload_cron()
Implementation of hook_cron(). Look for uploaded videos which have not been submitted (only previews) and delete them
File
- types/
video_upload/ video_upload.module, line 79 - Enable Uploaded videos support for video module.
Code
function video_upload_cron() {
/* look for crusty files */
$temppath = file_directory_temp() . '/video/';
$files = file_scan_directory(file_create_path($temppath), '.*');
foreach ($files as $file => $info) {
if (time() - filemtime($file) > 60 * 60 * 6) {
db_query("DELETE FROM {files} WHERE filename LIKE 'video_upload_temp.%' AND nid = 1 AND filepath = '%s'", $file);
file_delete($file);
}
}
}