Skip to content

[FrameworkBundle] Add cache:pool:clear command #19891

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

Merged
merged 1 commit into from
Sep 14, 2016

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? master
New feature? yes
Tests pass? yes
License MIT

Useful when deploying apps to get better control of cache pool clearing.

@Koc
Copy link
Contributor

Koc commented Sep 9, 2016

oh, yesterday I was thinking about it and want to create PR. You are the faster than me :D


if ($pool instanceof CacheItemPoolInterface) {
$pools[$id] = $pool;
} elseif ($pool instanceof CacheClearerInterface) {
Copy link
Member Author

Choose a reason for hiding this comment

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

should be instanceof Psr6CacheClearer

}

foreach ($clearers as $id => $clearer) {
$io->comment(sprintf('Calling cache clearer: <info>%s</info>', $id));
Copy link
Member

Choose a reason for hiding this comment

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

I think the clearer/pool specific messages should be displayed only if the output is verbose and maybe a global comment should be added before e.g. "Clearing the cache for pools ...", wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know :) Doesn't look verbose to me. (Not as an exception trace e.g.). So I'll follow any advises.

Copy link
Member

Choose a reason for hiding this comment

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

Sure, it's not very verbose until you have a lot of pools, I just refer to the clear cache command which hide details by default

{
$this
->setName('cache:pool:clear')
->setDefinition(array(
Copy link
Contributor

Choose a reason for hiding this comment

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

Just interesting - why not use addArgument here?

Copy link
Member Author

Choose a reason for hiding this comment

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

All the other commands use setDefinition, that's the reason :)

@fabpot
Copy link
Member

fabpot commented Sep 14, 2016

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 37c5b18 into symfony:master Sep 14, 2016
fabpot added a commit that referenced this pull request Sep 14, 2016
…s-grekas)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[FrameworkBundle] Add cache:pool:clear command

| Q             | A
| ------------- | ---
| Branch?       | master
| New feature?  | yes
| Tests pass?   | yes
| License       | MIT

Useful when deploying apps to get better control of cache pool clearing.

Commits
-------

37c5b18 [FrameworkBundle] Add cache:pool:clear command
@nicolas-grekas nicolas-grekas deleted the cache-pool-clearer branch September 14, 2016 19:25
@fabpot fabpot mentioned this pull request Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants