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.

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

报告相同问题?

悬赏问题

  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法