This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Adding option to change cache and tag file suffixes #120
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for contributing to zend-cache :) I understand your use case and it's fine for me even if I think that's a very low used feature but I have one small problem with it: What happens if the specified suffix contains a special character used by glob? Cheers |
Notes that they will be escaped to work with glob operations.
This patch achieves two goals: - It replaces all suffix concatenation with dedicated functions for appending the cache file suffix and the cache tag file suffix. These each use `sprintf` with the provided filename and the appropriate option pulled from `getOptions()`. - It adds a new method, `escapeSuffixForGlob()`, which is used to escape the suffix or tag suffix when creating strings for glob operations. This method escapes `*`, `?`, and `[` characters by wrapping them in `[]` brackets. This addresses feedback from @marc-mabe.
@Lansoweb I've rebased and incorporated the feedback from @marc-mabe . |
@weierophinney Great. Thanks! |
Bad merge brought it back; removed again.
Was incorrectly using `getFileContent()` instead of `getFileSpec()` when determining file name.
Filesystem adapter unit tests run properly, so going to go ahead and merge to develop. |
weierophinney
added a commit
that referenced
this pull request
Apr 17, 2018
weierophinney
added a commit
that referenced
this pull request
Apr 17, 2018
Thanks, @Lansoweb! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this PR we can change the suffix for cache files. One use case is to use the filesystem cache to generate zend-view files (phtml suffixes).