简体   繁体   English

原则和注释:表注释不是注释

[英]Doctrine and Annotation : table annotation is not an annotation

In the Windows environment, everything is fine and something strange happens when I deploy on the AIX environment. 在Windows环境中,一切都很好,当我在AIX环境中部署时,会发生一些奇怪的事情。

Here is an example of some entity classes : 这是一些实体类的示例:

use Doctrine\ORM\Mapping as ORM;

/**
* AgentImpl
*
* @ORM\Table(name="AH2AGENT")
* @ORM\Entity
*/
class AgentImpl
{
  ....
}

I have this exception : 我有这个例外:

[Semantical Error] The class "Doctrine\ORM\Mapping\Table" 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 "Doctrine\ORM\Mapping\Table". 
If it is indeed no annotation, then you need to add @IgnoreAnnotation("ORM\Table") to the _class_ doc comment of class Cramif\AccueilBundle\Entity\AgentImpl

What does that mean ? 这意味着什么 ? What should I do to make it work ? 我应该怎么做才能使其正常工作?

Thanks 谢谢

The solution is found. 找到解决方案。 Hope it will help someone. 希望它会帮助某人。

The fact is that we are using eAccelarator : it strips the comments out, so the annotation cannot work anymore. 事实是,我们使用的是eAccelarator:它会删除注释,因此注释不再起作用。

add .htaccess or inside the vhost : 添加.htaccess或在虚拟主机内:

php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0

and it works 它有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM