Remove most calls to get_all_supercache_filenames() #176

Open
wants to merge 3 commits into
from

Projects

None yet

1 participant

@donnchawp
Contributor

get_all_supercache_filenames() is used to get a list of index.html type
files for deleting. There are a number of duplicate foreach() loops in
wp-cache-phase2.php that should be rolled into one function.
This patch adds wpsc_delete_files() which takes a directory and deletes
any files in that directory. This goes beyond what the foreach() loops
did but also checks that the directory is in the cache directory so
should be safe to use.
It should make it easier to cache different types of pages and maintain
them using this function.

donnchawp added some commits Feb 1, 2017
@donnchawp donnchawp Remove most calls to get_all_supercache_filenames()
get_all_supercache_filenames() is used to get a list of index.html type
files for deleting. There are a number of duplicate foreach() loops in
wp-cache-phase2.php that should be rolled into one function.
This patch adds wpsc_delete_files() which takes a directory and deletes
any files in that directory. This goes beyond what the foreach() loops
did but also checks that the directory is in the cache directory so
should be safe to use.
It should make it easier to cache different types of pages and maintain
them using this function.
7fbb358
@donnchawp donnchawp Protect more directories and don't delete .htaccess files e842ba5
@donnchawp donnchawp Remove all the files in the supercache directory when deleted.
This removes all files in a particular supercache directory when deleted
from the settings page, rather than just the index.html types files.
11dbc4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment