You are here

function boost_block_flush_form_submit in Boost 7

File

./boost.blocks.inc, line 82
Prints the cache status of the currently displayed page.

Code

function boost_block_flush_form_submit() {
  $_boost = boost_transform_url();

  // We need the extension for the filename.
  $_boost['header_info'] = boost_get_header_info();
  $_boost['matched_header_info'] = boost_match_header_attributes($_boost['header_info']);
  $filename = $_boost['filename'] . '.' . $_boost['matched_header_info']['extension'];
  if (is_file($filename)) {
    if (unlink($filename)) {
      drupal_set_message(t('%filename was deleted from the Boost cache', array(
        '%filename' => $filename,
      )));
    }
    else {
      drupal_set_message(t('%filename could not be deleted, check file permissions on disk to see if the web server can write/delete the file.', array(
        '%filename' => $filename,
      )));
    }
  }
  else {
    drupal_set_message(t('%filename was not found in the Boost cache and could not be deleted.', array(
      '%filename' => $filename,
    )));
  }
}