Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fix for issue 6048 #6049

Merged
merged 5 commits into from
Apr 14, 2014
Merged

Fix for issue 6048 #6049

merged 5 commits into from
Apr 14, 2014

Conversation

brettmc
Copy link
Contributor

@brettmc brettmc commented Mar 27, 2014

Allow ExceptionHandler plugin to suppress exceptions from Filesystem::clearExpired, by having FileSystem::clearExpired trigger an exception event that ExceptionHandler will listen for.

…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();
Copy link
Member

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()

Copy link
Contributor Author

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
@Ocramius
Copy link
Member

Ocramius commented Apr 2, 2014

@brettmc this one needs a test that validates the fix

@Ocramius
Copy link
Member

Ocramius commented Apr 2, 2014

Related to #6048

@marc-mabe
Copy link
Member

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
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 that referenced this pull request Apr 14, 2014
@weierophinney weierophinney added this to the 2.3.1 milestone Apr 14, 2014
@weierophinney weierophinney merged commit d73d9fe into zendframework:master Apr 14, 2014
weierophinney added a commit that referenced this pull request Apr 14, 2014
@weierophinney weierophinney self-assigned this Apr 14, 2014
@brettmc brettmc deleted the 6048 branch April 15, 2014 23:20
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
- 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants