Symfony2 DoctrineFixturesBundle namespace error
I have a big problem with the instrumentation package that I cannot solve. I follow the steps that should be followed by adding lines to the deps file, installing them, registering at startup and appkernel.
When I try to run even only app/console
, it breaks down to:
Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand'
not found in /var/www/.../bundles/Doctrine/Bundle/FixturesBundle/
Command/LoadDataFixturesDoctrineCommand.php on line 40
Which seems to be correct because I don't have a DoctrineBundle directory underneath Doctrine\Bundle
, only DoctrineFixturesBundle
. If I change this line to Symfony\Bundle\DoctrineBundle\...
, it works fine because this class is under this namespace.
Of course, I cannot leave it. I have looked through the documentation, problems, everything, but it seems that nobody else has the same problem, so I have to leave out some of the obvious ones here.
Any ideas?
thank
source to share
Not too long ago, all Doctrine Bundles moved to the Doctrine organization . This is causing some confusion based on which repository and branch you are using.
If you are using Symfony 2.0.x, then yours deps
should look something like this:
[DoctrineFixturesBundle]
git=http://github.com/doctrine/DoctrineFixturesBundle.git
target=bundles/Symfony/Bundle/DoctrineFixturesBundle
version=origin/2.0
Please note that the target / namespace is actually Symfony\Bundle\DoctrineFixturesBundle
.
However, you shouldn't have any problems using the latter DoctrineFixturesBundle
with Symfony 2.0.x - if you update the rest of the Doctrine dependencies as well. You can use this instead deps
:
[doctrine-common]
git=http://github.com/doctrine/common.git
version=2.2.0
[doctrine-dbal]
git=http://github.com/doctrine/dbal.git
version=2.2.1
[doctrine]
git=http://github.com/doctrine/doctrine2.git
version=2.2.0
[doctrine-fixtures]
git=http://github.com/doctrine/data-fixtures.git
[DoctrineFixturesBundle]
git=http://github.com/doctrine/DoctrineFixturesBundle.git
target=bundles/Doctrine/Bundle/FixturesBundle
source to share