[英]Symfony2 : Share Bundles between 2 projects
Our company decided to move to Symfony2 and now we are trying to re-write our application. 我们公司决定迁移到Symfony2,现在我们正在尝试重新编写我们的应用程序。 I'm still new to Symfony2 and trying to figure out what is the best way to build the app.
我还是Symfony2的新手,并试图找出什么是构建应用程序的最佳方法。
our app consists of 2 part each part is on a different server: 我们的应用程序由两部分组成,每个部分位于不同的服务器上:
I'm planning to use Doctrine in A so i created all the required Entities, but i feel i need to share A entities with B since it's easier to create/validate forms using entities. 我打算在A中使用Doctrine,所以我创建了所有必需的实体,但是我觉得我需要与B共享A实体,因为使用实体创建/验证表单更容易。
Thanks 谢谢
I did not have the exact problem you described, but I wanted to share/extend some entities between applications in single project. 我没有您描述的确切问题,但是我想在单个项目中的应用程序之间共享/扩展某些实体。 However, I was recommended by good folks on SO to branch entire project.
但是,SO方面的好人推荐我来分支整个项目。
I suppose you will be using Git so you'll have two branches : A and B. Both will have common files (entities in you case), but will certainly contain different controllers/services as necessary. 我想您将使用Git,所以您将拥有两个分支 :A和B。这两个分支都将具有公用文件(在您的情况下为实体),但是必定会包含必要的不同控制器/服务。
Now, since you've mentioned two servers, not only you will have separated code but you will be able to set different deployment scripts both for A and B. 现在,由于您提到了两台服务器,因此不仅将有单独的代码,而且将能够为A和B设置不同的部署脚本。
The downside: I believe that some intermediate knowledge of git branching will be necessary. 缺点:我认为有必要掌握git分支的一些中级知识。
Is that acceptable for you? 你可以接受吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.