Skip to content

Remove most calls to get_all_supercache_filenames()#176

Merged
donnchawp merged 11 commits into
masterfrom
wpsc_delete_files
Feb 9, 2017
Merged

Remove most calls to get_all_supercache_filenames()#176
donnchawp merged 11 commits into
masterfrom
wpsc_delete_files

Conversation

@donnchawp
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

1 participant