Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant find base path for bundle

I'm using Symfony2 and want to generate getters and setters for the entities by running:

$ php app/console doctrine:generate:entities TestBundle

enter image description here

The Console returns me the following message:

[RuntimeException] Can't find base path for "TestBundle" (path: "C:\xampp\htdocs\ProjectX\src\Namespace\TestBundle", destination: "C:/xampp/htdocs/ProjectX/src/Namespace/TestBundle").

The Bundle exists at this location: C:\xampp\htdocs\ProjectX\src\Namespace\TestBundle

Whats wrong?

like image 594
David Avatar asked Nov 05 '13 07:11

David


1 Answers

Just to add something else in case others reach this. I had an issue causing the same error but it was due to my entities living in a codebase that used PSR-4. Doctrine does not support PSR-4 when doing anything with code generation. It has to do with how they map class namespaces to filesystem paths and how PSR-4 allows class/namespace paths that don't directly map to the filesystem.

https://github.com/doctrine/DoctrineBundle/issues/282

like image 94
John Pancoast Avatar answered Sep 30 '22 06:09

John Pancoast