-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.3][Enhancement][FrameworkBundle] Move the warmup logic to the CacheWarmerAggregate #6223
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
Conversation
rename($realCacheDir, $oldCacheDir); | ||
$oldCacheDir = $cacheDir.'__old__'; | ||
rename($cacheDir, $oldCacheDir); | ||
$this->getContainer()->get('filesystem')->remove($oldCacheDir); |
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.
This can be removed as it is already done after the condition.
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.
Actually, you should remove the other one instead.
@fabpot sorry for this messy PR, but I wanted to have some feedback before polishing the code. |
The approach looks good to me. The only thing I'm not sure about is whether the logic belongs to the cache warmer aggregate or to another (new) class (I tend to think that the latter would be better). |
You are probably right. It would also avoid a BC break (warmers position in the constructor). I'll update after I have time to think about it. |
@fabpot what about |
} | ||
|
||
// fix meta references to the Kernel | ||
foreach ($finder->files()->name('*.meta')->in($warmupDir) as $file) { |
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.
- is reusing the finder intended (or a bug) here ?
- is handling serialized class only (vs string, ie paths) intended ?
Thanks, too tired to figure out by myslef tonight !
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.
- all refs seem to be handled - 3rd party bundles ?
- I am mainly talking about the cache folder in string (ie
a:9:{i:0;C:46:"Symfony\Component\Config\Resource\FileResource":60:{s:52:"/var/www/sf2.2/app/cache/dev_new/as
)
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.
The reuse of the finder is indeed a bug.
…mer one Filters are cumulative
@schmittjoh would you please have a look why this fails when the cache folder is empty ?
|
It's not something that I can debug soon, but as a pointer it is likely On Mon, Dec 17, 2012 at 11:31 AM, Victor Berchet
|
Thanks, think I got it, need to test... magic values !!! On 12/17/2012 04:43 PM, Johannes wrote:
|
BC PR pending. On 12/17/2012 04:43 PM, Johannes wrote:
|
@fabpot this is ready to be merged @schmittjoh has merged the PR to the DIXtra |
So, you fixed Johannes bundle but what if other bundles out there did the same? What about reverting to using the current suffixes? |
I prefer to think that I have fixed the usage of magic values. May be the PR should not be squashed at it contains different things. |
This PR should be updated with the recent changes made to the |
It would probably have been smarter to merge this PR before #7360 but it's too late and we have introduced yet a new bug (schmittjoh/JMSDiExtraBundle#96). @jfsimon you will find the root cause of the bug you have introduced by looking at the comment of this PR (I did introduce the same bug at the start of the PR before making a fix on @schmittjoh repo). Anyway I don't have a lot of time to work on this now and the work should happen after @jfsimon has fixed his PR. @jfsimon could you please take care of syncing this PR once you're done - ping me if you need help. (This bug shows one more reason why magic values are evil for the ones who where not already convinced) |
@vicb I wished I find you on Jabber... wouldn't it be more simple to rebase your PR on master? |
@vicb PS: I have enough time to do it for you. |
here I am... soon |
Hey guys, this is blocking us pretty hard in our current project where we're trying to use @secure to secure a REST API in Symfony2. Is there a way for us to help get this done? I'm willing to help any way I can including getting final code together for a pull request. Thanks! |
I won't have time to look into this before the end of this week. This is a bit tricky as the root cause of the issue has not been really identified (according to @jfsimon himself). I am talking about the fix done in #7360, not the "new" issue. Then we have two options:
@fabpot what do you think ? The current issue is not related to this PR and discussions should better switch to #7505 from now. |
This is mainly moving logic from the cache clear command to its own class so that it could be called more easily (ie from the WDT).
Feedback ?