May I change the default Symfony2 structure to fit my needs?
I like the follow structure, but don’t know how to get it to working..
core/ <- Symfony2 core files
app/ <- All applications
app/Acme/ <- Application for Acme enterprise (with all bundles..)
app/clientone.com/ <- Application for Client One enterprise (with all bundles..)
Inside symfony2 distribution there are 4 main directories:
there could be bundle ClientoneBundle which is specific to only this application,
but also could be a bundle reused among your applications,- such as UserBundle)
So if you have several applications you could keep vendors separately. And each of your application may contain three directories like:
– apps/acme/app
– apps/acme/src
– apps/acme/web
– apps/clientone/app
– apps/clientone/src
– apps/clientone/web
– some/where/else/in/filesystem/vendor
To implement such setup is very easy,- all you have to do is edit your autoload.php (which resides in app dir), just replace everywhere
__DIR__.'/../vendorto__DIR__.'/../vendor,in other words, tell symfony2 that you moved vendors somewhere else.
(I just renamed app directory in your setup to apps – to be not confused with app directory, inside each of your application)