Skip to content

Instantly share code, notes, and snippets.

@ericalli
Created October 19, 2015 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericalli/ab31b4107647838cfa0a to your computer and use it in GitHub Desktop.
Save ericalli/ab31b4107647838cfa0a to your computer and use it in GitHub Desktop.
public function check_cache() {
$group_handles = array();
foreach ( $this->queue as $group => $assets ) {
$group_handles[] = $this->get_concatenated_filename( $group );
}
$cache_dir = trailingslashit( $this->cache_dir );
if ( is_dir( $cache_dir ) ) {
foreach( scandir( $cache_dir ) as $cached_src ) {
if ( ! in_array( $cached_src, $group_handles ) ) {
unlink( $cache_dir . DIRECTORY_SEPARATOR . $cached_src );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment