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

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?

图片转代码服务由CSDN问答提供 功能建议

我在Symfony2上运行3个具有相同应用程序的站点,所有这些站点都有自定义的AppKernel.php文件。 我现在升级到Symfony3,似乎composer.json默认包含文件“app / AppKernel.php”和“app / AppCache.php”。 我想为站点A提供app / AppKernel.php,为站点B提供apps / siteB / app / AppKernel.php。如何设置自定义AppKernel位置?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

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.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题