Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove most calls to get_all_supercache_filenames() #176

Merged
merged 11 commits into from Feb 9, 2017

Conversation

donnchawp
Copy link
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 and others added 11 commits February 1, 2017 18:13
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.
This removes all files in a particular supercache directory when deleted
from the settings page, rather than just the index.html types files.
Windows changes / to \ when paths go through realpath() so we need to
apply realpath to all paths when there's a comparison.
This function will respect the rebuild setting in the function.

The delete function will now also remove the directory after deleting
all the files in the directory.
@donnchawp donnchawp merged commit 41d582b into master Feb 9, 2017
@donnchawp donnchawp deleted the wpsc_delete_files branch February 9, 2017 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant