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

Cache warmup feature #615

Merged
merged 12 commits into from
Nov 22, 2017
Merged

Cache warmup feature #615

merged 12 commits into from
Nov 22, 2017

Conversation

goetas
Copy link
Collaborator

@goetas goetas commented Nov 16, 2017

Fixes #611

This will allow to warmup the metadata cache

@goetas goetas changed the title Cache warmup feature [WIP] Cache warmup feature Nov 16, 2017
foreach ($this->directories as $directory) {
$files = glob($directory, GLOB_BRACE);
foreach ($files as $file) {
$className = false; // @todo
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

has anybody a nice way to find all the defined classes inside a file?

checked few answers on stack overflow but all the proposed solutions are "ugly"

Copy link

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

great! a good copy & paste should do the job!

@@ -64,6 +64,8 @@

<parameter key="jms_serializer.accessor_strategy.default.class">JMS\Serializer\Accessor\DefaultAccessorStrategy</parameter>
<parameter key="jms_serializer.accessor_strategy.expression.class">JMS\Serializer\Accessor\ExpressionAccessorStrategy</parameter>

<parameter key="jms_serializer.cache.cache_warmer.class">JMS\SerializerBundle\Cache\CacheWarmer</parameter>
Copy link

@Xymanek Xymanek Nov 16, 2017

Choose a reason for hiding this comment

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

Don't Symfony's best practices say to not use .class parameters? Framework extra bundle removed them (pre-last point)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm. true

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Decided to leave this as currently the bundle is still using the old convention. Do not want to mix conventions.

While changing it will be a BC break. Maybe for the version 3.0

@goetas goetas changed the title [WIP] Cache warmup feature Cache warmup feature Nov 19, 2017
@goetas
Copy link
Collaborator Author

goetas commented Nov 19, 2017

Ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants