You are here

function flashnode_cron in Flash Node 5.6

Same name and namespace in other branches
  1. 5.2 flashnode.module \flashnode_cron()
  2. 5.3 flashnode.module \flashnode_cron()

Implements hook_cron (delete old temp files)

File

./flashnode.module, line 130

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);
    }
  }
}