php – 与@Annotation无关的Symfony2 ParamConverter(任何文件更改后必须清除缓存)

前端之家收集整理的这篇文章主要介绍了php – 与@Annotation无关的Symfony2 ParamConverter(任何文件更改后必须清除缓存)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个Controller,它使用路由,方法,模板和ParamConverter的注释.
如果我对下一页上的文件进行任何更改(甚至是空白更改或注释),则会发生以下错误
Cannot import resource "/home/sites/MySite/src/Acme/Bundle/MyBundle/Controller/" from "/home/sites/MySite/app/config/routing.yml".

FileLoaderLoadException: Cannot import resource "/home/sites/MySite/src/Acme/Bundle/MyBundle/Controller/" from "/home/sites/MySite/app/config/routing.yml"

AnnotationException: [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 Acme\Bundle\MyBundle\Controller\DefaultController::viewAction().

如果我清除缓存,那么它将再次工作,但只有在我做了另一次更改之后,它才会再次发生.
在读取配置的注释信息时,它似乎遇到了问题,但我无法理解为什么当实际上没有对任何注释进行更改时它工作/不起作用.

啊,这是一个已知的bug,已在FrameworkExtraBundle中修复.

https://github.com/symfony/symfony/issues/7283

现在要获取最新版本,只需将该库的需求更改为dev-master即可

"require": {
    ...
    "symfony/symfony": "2.2.*","sensio/framework-extra-bundle": "dev-master",...
},

并运行composer update

原文链接:https://www.f2er.com/php/138481.html

猜你在找的PHP相关文章