作曲家删除Web /捆绑中的部门 [英] composer removes diectories in web/bundles

查看:57
本文介绍了作曲家删除Web /捆绑中的部门的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Symfony2和作曲家的新手。我通常通过将框架代码也提交到svn或使用链接的存储库来管理svn中的所有项目代码。我知道大多数Symfony捆绑软件都使用git来进行版本控制。

I'm new to Symfony2 and composer. I normally manage all project code in svn, either by committing framework code to svn as well or using linked repositories. I understand that most Symfony bundles use git for revision control.

用composer安装新捆绑软件时,我遇到了一个奇怪的问题。例如,要安装FOSUserBundle,我将添加到composer.json:

I'm having an odd issue happening when installing new bundles with composer. For example to install FOSUserBundle, I add to composer.json:

"friendsofsymfony/user-bundle": "*"

然后我运行

php composer.phar update friendsofsymfony/user-bundle

此功能正常,但它删除了来自网络/捆绑包的所有文件夹,例如

This works fine, but it removes all folders from web/bundles, for example

~       web/bundles/framework
~       web/bundles/sensiodistribution

这是作曲家中的配置问题还是与svn不兼容?

Is this a configuration problem in composer or some sort of incompatibility with svn?

推荐答案

在更新过程中重新生成这些文件夹是完全正常的。这是更新后/安装脚本的一部分。

It is perfectly normal that these folders are regenerated during update. This is part of the post-update/-install scripts.

推荐的.gitignore文件包含Web /捆绑包,因此我想您应该将文件夹添加到中。 svnignore也是如此。或者,您可以从composer.json中删除post post update / -install挂钩。但是由于资产是从资源包/ public /中复制到web /文件夹中才能访问的,因此您必须在虚拟主机或其他内容中为它们加上别名...

The recommended .gitignore-file contains web/bundles, so I guess you should add the folder to your .svnignore as well. Alternatively you yould remove the post post-update/-install hooks from your composer.json. But since the assets are copied from the bundles Resources/public/ to the web/ folder in order for them to be accessible, you would have to alias them in your vhost or something...

简而言之,只需将网络/捆绑包添加到您的.svnignore

In short, just add web/bundles to your .svnignore

这篇关于作曲家删除Web /捆绑中的部门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆