You are here

function boost_cache_flush_by_filename in Boost 6

Expires the static file cache for files given.

Parameters

array $filenames: filenames

$force_flush: If true get all chached files that start with this path.

2 calls to boost_cache_flush_by_filename()
boost_cache_expire_by_db in ./boost.module
Expires the static file cache for the given paths via database.
boost_cache_expire_by_filename in ./boost.module
Expires the static file cache for paths matching a wildcard via filesystem.

File

./boost.module, line 3367
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_cache_flush_by_filename($filenames, $force_flush = FALSE) {
  global $_boost;
  $files = array();
  if ($filenames) {
    $filenames = array_unique($filenames);
    foreach ($filenames as $filename) {
      $files[] = array(
        'filename' => $filename,
      );
    }
    $counter = boost_cache_kill($files, $force_flush);
    if (BOOST_VERBOSE >= 9 && isset($_boost['verbose_option_selected']['boost_cache_flush_filename'])) {
      watchdog('boost', 'Debug: boost_cache_flush_by_filename() <br />Following files where flushed: <br />!list', array(
        '!list' => implode('<br />', $filenames),
      ));
    }
    return $counter;
  }
  else {
    return FALSE;
  }
}