Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Added classes to cache #197

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

dlsniper commented Feb 13, 2013

Hello,

This commit adds some used classes to Symfony2 cache.
See the talk in sensio/SensioDistributionBundle#76

Let me know if it needs anything else/if I've did it against the wrong branch (it should go into 2.2 distro).

Thanks.

Contributor

dlsniper commented Feb 28, 2013

When will this be merged? ping :)

Owner

fabpot commented Feb 28, 2013

We should add the classes only if we are sure that they will be used. So, they should be added only when the related configuration setting is enabled.

Contributor

dlsniper commented Feb 28, 2013

I think this should be a little bit better now.

@fabpot fabpot commented on an outdated diff Feb 28, 2013

DependencyInjection/SensioFrameworkExtraExtension.php
}
if ($config['cache']['annotations']) {
$annotationsToLoad[] = 'cache.xml';
+
+ $this->addClassesToCompile(array(
+ 'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\CacheListener',
+ ));
+ }
+
+ if (empty($annotationsToLoad)) {
+ return ;
@fabpot

fabpot Feb 28, 2013

Owner

Can you avoid the early return as it looks inconsistent with the other conditions. Thanks.

@fabpot fabpot commented on the diff Feb 28, 2013

DependencyInjection/SensioFrameworkExtraExtension.php
@@ -35,28 +35,56 @@ public function load(array $configs, ContainerBuilder $container)
if ($config['router']['annotations']) {
$annotationsToLoad[] = 'routing.xml';
+
@fabpot

fabpot Feb 28, 2013

Owner

extra blank line

@fabpot fabpot closed this in 50cfef6 Feb 28, 2013

Contributor

apfelbox commented Mar 4, 2013

There is an issue with this commit:
when the classes are added to the cache, the comment is omitted. And therefore the (required) @Annotation annotation.

This frequently throws errors when developing in the dev environment (works fine in prod).

[Semantical Error] The class "Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter" is not annotated with @annotation. Are you sure this class can be used as annotation? If so, then you need to add @annotation to the class doc comment of "Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter". If it is indeed no annotation, then you need to add @ignoreannotation("ParamConverter") to the class doc comment of method ...Controller::editAction().

Contributor

apfelbox commented Mar 4, 2013

See #206

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