当我更新自动生成的文件时,Doctrine解析错误

时间:2016-05-05 08:07:23

标签: symfony doctrine-orm annotations

首先,我通过doctrine控制台命令生成实体文件

php bin/console doctrine:mapping:import MyBundle annotation --filter=TblMyTable
php bin/console doctrine:generate:entities MyBundle:TblMyTable --no-backup

程序正常运行。但是,当我通过任何文本编辑器更新此文件时,我给出了一个例外:

[Semantical Error] The annotation "@Doctrine\ORM\Mapping\I" in property
MyBundle\Entity\TblMyTable::$myId does not exist, or could not be auto-loaded.

我已经检查了实体文件版本之前和之后的编码和行尾字符。但我没有看到任何区别!

我的环境:

    symfony: 3.0.5
    doctrine/orm: 2.5
    doctrine/doctrine-bundle: 1.6
    doctrine/dbal: 2.5.4

1 个答案:

答案 0 :(得分:0)

据我所知,doctrine解析器有一个“i”字符的错误。因为“i”字符的大写“I”或“İ”。 “i”字符被认为是unicode。 Doctrine解析器不支持unicode。

我在控制台

上使用此命令修复了此问题
export LC_ALL=C

此命令完全符合以下描述的工作: https://unix.stackexchange.com/questions/87745/what-does-lc-all-c-do