Symfony缓存:使用@Method Annotation清除语义错误

时间:2015-01-22 12:01:55

标签: php annotations

运行时,在我的生产版本上

php app/console cache:clear --env=prod --no-debug

Symofny抛出AnnotationExeption

[Symfony\Component\Config\Exception\FileLoaderLoadException]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
Cannot import resource "<path>/App/AppBundle/Controller/DefaultController.php" from "<path>/App/AppBundle/Resources/config/routing.yml". ([Semantical Error] The class "Method" 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 "Method". If it is indeed no annotation, then you need to add @IgnoreAnnotation("Method") to the _class_ doc comment of class @Sensio\Bundle\FrameworkExtraBundle\Configuration\Method.)  

[Doctrine\Common\Annotations\AnnotationException]                                                                                                                                                                                                                                                                                                                                          
[Semantical Error] The class "Method" 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 "Method". If it is indeed no annotation, then you need to add @IgnoreAnnotation("Method") to the _class_ doc comment of class @Sensio\Bundle\FrameworkExtraBundle\Configuration\Method.  

不知道为什么,在我的本地电脑上工作正常。使用symfony注释的其他项目工作正常。

套餐版本:http://pastebin.com/71ZNrwSc

1 个答案:

答案 0 :(得分:0)

已经解决了

"sensio/framework-extra-bundle": "dev-master",

与此问题相同 Symfony2 ParamConverter not associated with @Annotation (cache must be cleared after any file change)

相关问题:https://github.com/symfony/symfony/issues/7283