dongying195959 2016-01-01 19:32
浏览 114
已采纳

Symfony3使用多个AppKernel.php

I run with 3 sites with the same app on Symfony2, all of these sites have a custom AppKernel.php file. I'm now upgrading to Symfony3 and it seem that the composer.json including by default the file "app/AppKernel.php" and "app/AppCache.php". I would like to provide app/AppKernel.php for site A and apps/siteB/app/AppKernel.php for site B. How can i set a custom AppKernel location?

  • 写回答

1条回答 默认 最新

  • duanlei1957 2016-01-01 21:22
    关注

    I see three easy solutions for you:

    1. Remove the autoload entries for the AppKernel and AppCache class from the composer.json file.

    2. Use different namespaces for each kernel class, change the autoload configuration to be able to load all of them and use the right namespace when creating and booting the kernel.

    3. Similar to 2.: Do not add namespaces but use different class names for the different kernels.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?