This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
…urrent filesystem caches try to clear expired items. To avoid this causing an exception for a user session, arrange for Filesystem::clearExpired to trigger a 'clearExpired.exception' event. This should give the same functionality as currently exists. Also, have the ExceptionHandler plugin listen for the clearExpired.exception event, and suppress it as per other exceptions.
throw new Exception\RuntimeException("Failed to clear expired items", 0, $error); | ||
$e = new Exception\RuntimeException("Failed to clear expired items", 0, $error); | ||
$result = false; | ||
$args = new \ArrayObject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to define all these parameters as variables before executing $this->triggerException()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks a little unwieldly, but is this preferable?
return $this->triggerException(__FUNCTION__, new \ArrayObject(), $result, new Exception\RuntimeException("Failed to clear expired items", 0, $error));
I've left $result as a variable as it's passed by reference.
…eSystem::clearExpired method per feedback from initial pull request
@brettmc this one needs a test that validates the fix |
Related to #6048 |
looks good to me 👍 |
… read-only, unlink() will fail, causing the exception event to be triggered. Ensure that an empty ArrayObject is passed to triggerException - null does not work
…e exception event is handled as expected. Add use statements for plugin and options.
weierophinney
added a commit
that referenced
this pull request
Apr 14, 2014
- single instead of double quotes - space following conditional declaration
weierophinney
added a commit
to zendframework/zend-cache
that referenced
this pull request
May 15, 2015
Fix for issue 6048
weierophinney
added a commit
to zendframework/zend-cache
that referenced
this pull request
May 15, 2015
- single instead of double quotes - space following conditional declaration
weierophinney
added a commit
to zendframework/zend-cache
that referenced
this pull request
May 15, 2015
weierophinney
added a commit
to zendframework/zend-cache
that referenced
this pull request
May 15, 2015
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.
Allow ExceptionHandler plugin to suppress exceptions from Filesystem::clearExpired, by having FileSystem::clearExpired trigger an exception event that ExceptionHandler will listen for.