我正在使用symfony 2.4.2: 执行这个命令:
php app / console doctrine:generate:entities SdzBlogBundle:Article
我的控制台出现此错误:
PHP Unknown error: getEntityNamespace is deprecated since Symfony 2.1. Use getA
liasNamespace instead in C:\wamp\www\Symfony1\vendor\doctrine\doctrine-bundle\Do
ctrine\Bundle\DoctrineBundle\Registry.php on line 129
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Symfony1\app\console:0
PHP 2. Symfony\Component\Console\Application->run() C:\wamp\www\Symfony1\app\c
onsole:27
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\wamp\www
\Symfony1\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:1
24
PHP 4. Symfony\Component\Console\Application->doRun() C:\wamp\www\Symfony1\ven
dor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:9
6
PHP 5. Symfony\Component\Console\Application->doRunCommand() C:\wamp\www\Symfo
ny1\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:193
PHP 6. Symfony\Component\Console\Command\Command->run() C:\wamp\www\Symfony1\v
endor\symfony\symfony\src\Symfony\Component\Console\Application.php:896
PHP 7. Doctrine\Bundle\DoctrineBundle\Command\GenerateEntitiesDoctrineCommand-
>execute() C:\wamp\www\Symfony1\vendor\symfony\symfony\src\Symfony\Component\Con
sole\Command\Command.php:252
PHP 8. Doctrine\Bundle\DoctrineBundle\Registry->getEntityNamespace() C:\wamp\w
ww\Symfony1\vendor\doctrine\doctrine-bundle\Doctrine\Bundle\DoctrineBundle\Comma
nd\GenerateEntitiesDoctrineCommand.php:101
PHP 9. trigger_error() C:\wamp\www\Symfony1\vendor\doctrine\doctrine-bundle\Do
ctrine\Bundle\DoctrineBundle\Registry.php:129
Generating entity "Sdz\BlogBundle\Entity\Article"
> backing up Article.php to Article.php~
> generating Sdz\BlogBundle\Entity\Article
答案 0 :(得分:2)
自Doctrine Bundle的v1.3.0-beta1开始修复:https://github.com/doctrine/DoctrineBundle/commit/80a7198c470d74755db64aa3f75898f3808778b7
尝试
composer update doctrine/doctrine-bundle