To bring this up again, i think this is the best multi app structure for a project (@Cédric Lahouste). The main reason i use this is because of APC. This way common php files like inside vendors/* or src/*etc. are only compiled once in APC memory, and not for each directory (project). Having 2 or more projects, each in a different folder will waste more APC memory for common files, like the whole Symfony2 framework.
As Fabien said, most of the time you won't need more than one app in a project. If you need a "backend", you can always route anything after "www.domain.com/backend" to a specific bundle and handle it there (while having access to all other bundles). But if you (like me) prefer a clean separation (different cache & log dirs, different set of shared bundles etc.) then this approach is great. Almost all console commands have an option for a different app path. You can for example use "backoffice/console assets:install web/backoffice" to install all assets in the right place. The only catch i found so far is the use of "vendors.php" and "build_bootstrap.php", where the "app" path is hardcoded. So this multi app functionality is possible, but not promoted like in symfony 1. Michael On Thursday, June 23, 2011 9:46:30 PM UTC+2, Cédric Lahouste wrote: > > I don't understand why we need only one application. Could you explain > more about it? > > If there are bundles, they could be used by more than one project (and > more in local dev, I guess). > > In local, I am using this structure: > app/console + web/app: symfony-standard > app1/console + web/app1 : project 1 => www.project1.local > app2/console + web/app2 : project 2 => www.project2.local > app3/console + web/app3 : project 3 => www.project3.local > Using this structure, vendors & own bundles are totally shared. > > Regards, > > On 23 juin, 12:36, Fabien Potencier <fabien.potenc...@symfony- > project.com> wrote: > > On 6/23/11 9:52 AM, Robert Knutsson wrote: > > > > > > > > > > > > > > > > > > > > > Hi > > > > > I needed two applications in my symfony2 project and read the manual > > > (http://symfony.com/doc/2.0/cookbook/symfony1.html) where > > > the concept of applications in symfony2 was explained. > > > > > Although the manual is very vague on how to implement two > > > applications, and there is no "best-practice" to be found on the > > > subject. > > > > > My issue is that I wanna keep duplicated code to a minimum, and I need > > > some input on how to not duplicate "bootstrap.php.cache", > > > "autoload.php" and "console". > > > > > Could you recommend me some best practices when it comes to multiple > > > applications in symfony2 or share your experiences? > > > > Short answer: You never need more than one application in Symfony2. > > > > Can you explain why you want to create two applications? > > > > Fabien > > > > > > > > > > > > > > > > > Cheers, > > > Robert -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
