-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Cache warmup feature #615
Conversation
Cache/CacheWarmer.php
Outdated
foreach ($this->directories as $directory) { | ||
$files = glob($directory, GLOB_BRACE); | ||
foreach ($files as $file) { | ||
$className = false; // @todo |
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.
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"
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 is how composer does it: https://github.com/composer/composer/blob/master/src/Composer/Autoload/ClassMapGenerator.php#L120-L214
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.
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> |
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.
Don't Symfony's best practices say to not use .class
parameters? Framework extra bundle removed them (pre-last point)
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.
hmm. true
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.
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
Ready for review |
Fixes #611
This will allow to warmup the metadata cache