在 symfony 项目中使用线程的 FPM 与 CLI。如何管理类?

FPM vs CLI with threads in symfony project. How to manage classes?

我有一个 symfony 项目和一些需要 pthread 扩展的 symfony 服务(symfony 命令)。所有需要 pthread 的 类 都打包在一个包中。此捆绑包与其他捆绑包具有依赖关系,但反之亦然。

因为 fpm 模式不支持 Pthread 扩展(该死的!!!)。

我怎样才能 "hide" 所有 类 使用 pthread 的人都可以将所有东西放在同一个存储库中?我需要在 fpm WITHOUT 线程和 cli WITH 线程中使用 web 部件。

有什么想法吗?

添加AppKernel解决了

if (extension_loaded('pthreads')) {
   $bundles[] = new xxxxx\xxxxxxxx\xxxxxxBundle();
}