Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
806 views
in Technique[技术] by (71.8m points)

doctrine orm - Doctrine2 - No Metadata Classes to process

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

question from:https://stackoverflow.com/questions/17473225/doctrine2-no-metadata-classes-to-process

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration([__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([__DIR__."/src"], $isDevMode, null, null, false);

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...