You are here

function advagg_delete_file_by_uri in Advanced CSS/JS Aggregation 7.2

Delete a file, and any compressed versions.

Parameters

string $uri: URI of the file to delete.

Return value

string The given URI.

3 calls to advagg_delete_file_by_uri()
advagg_delete_files_if_empty in ./advagg.cache.inc
Given an array of files remove that file if it is empty.
advagg_delete_files_if_orphaned in ./advagg.cache.inc
Given an array of files remove that file if there is no associated db record.
advagg_delete_files_if_stale in ./advagg.cache.inc
Given an array of files remove that file if atime is grater than 30 days.

File

./advagg.cache.inc, line 348
Advanced CSS/JS aggregation module.

Code

function advagg_delete_file_by_uri($uri) {
  if (file_exists($uri)) {
    file_unmanaged_delete($uri);
  }
  if (file_exists($uri . '.gz')) {
    file_unmanaged_delete($uri . '.gz');
  }
  if (file_exists($uri . '.br')) {
    file_unmanaged_delete($uri . '.br');
  }
  return $uri;
}