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

[5.0] Add argument to cache:clear to specify store name. #7930

Merged
merged 1 commit into from
Mar 11, 2015

Conversation

willrowe
Copy link
Contributor

Sorry about the delay. This is #7893 retargeted for 5.0.
This adds an argument to the cache:clear command so that you can specify the store that will be cleared. If nothing is passed it will clear the default store as it normally does. Tests included.

$this->cache->flush();
try {
$cacheStore = $this->cache->store($storeName);
} catch (\InvalidArgumentException $e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't catch this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the advantage to letting it bubble instead of displaying a succinct message to the user?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message should already be succinct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, we throw an exception when a command is not found, and that's totally readable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot how exceptions were rendered out, that's perfect. I'll change it.

@willrowe willrowe force-pushed the add-cache-clear-argument branch from 6ea0a5e to f1c12d6 Compare March 10, 2015 23:29
@willrowe
Copy link
Contributor Author

Try/catch block removed.

taylorotwell added a commit that referenced this pull request Mar 11, 2015
[5.0] Add argument to cache:clear to specify store name.
@taylorotwell taylorotwell merged commit 9fd19a6 into laravel:5.0 Mar 11, 2015
@willrowe willrowe deleted the add-cache-clear-argument branch March 11, 2015 03:27
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.

3 participants