Doctrine2 - 没有要处理的元数据类 [英] Doctrine2 - No Metadata Classes to process
问题描述
文档或我有问题.我做所有文件所说的.
Something is wrong with documentation or me. I do all what documentation says.
当我输入终端时:
$ php vendor/bin/doctrine orm:schema-tool:create
输出是:
No Metadata Classes to process
我阅读了很多帖子,谷歌并尝试了很多例子,但什么都没有.
I read to many posts, and google and try to many examples but nothing.
http://docs.学说-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html
推荐答案
我认为您从 Doctrine2:入门:
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration([__DIR__."/src"], $isDevMode);
现在的技巧是 Setup::createAnnotationMetadataConfiguration
方法默认使用 SimpleAnnotationReader
.您可以通过将第五个参数更改为 false
来更改此行为:
The trick is now that the Setup::createAnnotationMetadataConfiguration
method uses a SimpleAnnotationReader
by default. You can change this behaviour by changing the fifth parameter to false
:
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration([__DIR__."/src"], $isDevMode, null, null, false);
这将强制 Doctrine 使用不简单的 AnnotationReader
,它现在可以处理您的模型!
This will force Doctrine to use the not-simple AnnotationReader
which can handle your models now!
这篇关于Doctrine2 - 没有要处理的元数据类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!