You are here

function bootstrap_optimizer_remove_broken_files in Bootstrap optimizer 7

Analyzes every row in {system} table and delete broken files.

1 string reference to 'bootstrap_optimizer_remove_broken_files'
bootstrap_optimizer_admin_form_submit in ./bootstrap_optimizer.admin.inc
Submit callback for bootstrap optimizer administrative form.

File

./bootstrap_optimizer.module, line 69
Module core functions.

Code

function bootstrap_optimizer_remove_broken_files($filepath, &$context) {
  $file_exists = file_exists($filepath);
  if (!$file_exists) {

    // Delete file from {system} table.
    db_delete('system')
      ->condition('filename', $filepath)
      ->execute();

    // Log deleted file.
    $context['results']['removed_files'][] = $filepath;
  }
}