Doctrine2 - 没有要处理的元数据类 [英] Doctrine2 - No Metadata Classes to process

查看:131
本文介绍了Doctrine2 - 没有要处理的元数据类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文件或我有问题。我做了所有的文件说明。



当我放入终端:

  $ php vendor / bin / doctrine orm:schema-tool:create 

输出是:

 没有元数据类处理

我阅读了许多帖子,并且google尝试了很多例子,但没有任何内容。



http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html

解决方案

我想你从 Doctrine2:入门

  $ isDevMode = true; 
$ config = Setup :: createAnnotationMetadataConfiguration(array(__ DIR __。/ src),$ isDevMode);

现在,诀窍是,安装:: createAnnotationMetadataConfiguration 方法使用SimpleAnnotationReader默认。您可以通过将第五个参数更改为false来更改此行为:

  $ isDevMode = true; 
$ config = Setup :: createAnnotationMetadataConfiguration(array(__ DIR __。/ src),$ isDevMode,null,null,false);

这将强制Doctrine使用可以处理您的模型的不简单的AnnotationReader!


Something is wrong with documentation or me. I do all what documentation says.

When i put in terminal :

$ php vendor/bin/doctrine orm:schema-tool:create

Output is :

No Metadata Classes to process

I read to many posts, and google and try to many examples but nothing.

http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html

解决方案

I think you took the config example from Doctrine2: getting started:

$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src"), $isDevMode);

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(array(__DIR__."/src"), $isDevMode, null, null, false);

This will force Doctrine to use the not-simple AnnotationReader which can handle your models now!

这篇关于Doctrine2 - 没有要处理的元数据类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆