5

I changed the psr-0 autoloading to psr-4 for a few of my bundles. Now, when I try to generate entities with the app/console command, it gives me

Can't find base path for "MbDbFooBundle" (path: "/home/roland/projects/rolandtest/mbmbisbundle/Symfony/vendor/mb/mb-db-foo-bundle", destination: "/home/roland/projects/rolandtest/mbmbisbundle/Symfony/vendor/mb/mb-db-foo-bundle").

At first I thought it would be a problem with the generated autoloaders. But when I do a new clone of my project, and then run composer update to complete the vendors, it still gives me this error.

André Dion
  • 21,269
  • 7
  • 56
  • 60
rolandow
  • 1,049
  • 1
  • 15
  • 28

1 Answers1

6

In regards to the code generation parts of Doctrine, it doesn't support PSR-4. Only PSR-0. The reason is that it directly converts class/namespace paths to filesystem paths (e.g., converting \ to /). This doesn't work for PSR-4 because it allows for namespaces that don't directly correlate with filesystem paths.

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

John Pancoast
  • 1,241
  • 16
  • 14