I have a number of private, custom bundles that I use in my Symfony projects. Under Symfony 3, they lived in a sub-directory of src:
src/ DSL/ DSLLibraryBundle/ DSLTelnetBundle/ ... SiteBundle/ # (or AppBundle) Under Symfony 4, the application-specific bundle is gone and it's unclear to me where my custom bundles should live.
The documentation on bundles (https://symfony.com/doc/current/bundles/best_practices.html#bundles-naming-conventions) provide no specific recommendations for placing custom bundles.
I have tried placing my DSL directory directly under the project directory and under src/. I end up with undefined class errors either way.
I currently have:
src/ DSL/ LibraryBundle/ DSLLibraryBundle.php The bundle file:
// src/DSL/DSLLibrary/DSLLibraryBundle.php: namespace DSL\LibraryBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class DSLLibraryBundle extends Bundle { } The entry in bundles.php:
DSL\LibraryBundle\DSLLibraryBundle::class => ['all' => true], Current error when running a console command:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "DSLLibraryBundle" from namespace "DSL\LibraryBundle".
A couple of notes:
- My custom bundles are not installed via Composer
- The actual DSL/ directory will be a symlink once I get this working