简体   繁体   English

Symfony自己的供应商捆绑包依赖性

[英]Symfony own vendor bundle dependencies

So I have created my own vendor bundle that will essesntially contain our "in-house" framework which will be required by all our application using composer. 因此,我创建了我自己的供应商捆绑包,其中将基本上包含我们的“内部”框架,这对于使用composer的所有应用程序都是必需的。

I have followed this guide: Symfony2 - creating own vendor bundle - project and git strategy 我遵循了此指南: Symfony2-创建自己的供应商捆绑包-项目和git策略

But my "in-house" framework bundle has a dependency on another bundle and that bundle needs to be registered into the app kernel. 但是我的“内部”框架捆绑包依赖于另一个捆绑包,该捆绑包需要注册到应用内核中。

Below is my reusable framework bundle which every app we develop will require. 以下是我可重用的框架捆绑包,我们开发的每个应用程序都需要。 But the app framework bundle needs to register 3rd party bundles such as Predis and redis-bundle. 但是应用程序框架捆绑包需要注册第三方捆绑包,例如Predis和redis-bundle。

Anyway I can register those bundle so the app that requires this vendor package doesnt have to include all the framework dependency bundles in it's own AppKernel.php file? 无论如何,我都可以注册这些捆绑包,因此需要此供应商软件包的应用程序不必在其自己的AppKernel.php文件中包括所有框架依赖包? Maybe the has it's own AppKernel file that "tacks" on the dependencies? 也许有它自己的AppKernel文件可以“依赖”这些文件?

MyCompany/
├─ AppFrameworkBundle.php
├─ Controller/
├─ README.md
├─ LICENSE
├─ Resources/
│   ├─ config/
│   │  └─ config.yml <- this and other 3rd party bundle configuration
│   ├─ doc/
│   │  └─ index.rst
│   ├─ translations/
│   ├─ views/
│   └─ public/
└─ Tests/

Sorry if the explanation is a bit vague. 抱歉,解释有点含糊。

Kind Regards 亲切的问候

The question is yes. 问题是。

You will not find the answer inside the Symfony Core, but there is a package that just covers this need. 您不会在Symfony Core中找到答案,但是有一个软件包可以满足此需求。

https://github.com/mmoreram/symfony-bundle-dependencies https://github.com/mmoreram/symfony-bundle-dependencies

In all my projects I'm using it, not because makes me cooler, but because I want to really respect the integrity of all my bundles, and without this library, my bundles have not integrity at all (it sounds like when Symfony was at 2.0 with deps files, instead of going on top of composer) 在我所有的项目中,我都在使用它,不是因为让我变得更酷,而是因为我想真正尊重我所有捆绑软件的完整性,并且没有这个库,我的捆绑软件根本就没有完整性(听起来就像Symfony在2.0与deps文件,而不是放在作曲家的顶部)

ATM, no other option. ATM,没有其他选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM