作曲家-如何忽略某些地图文件? [英] Composer - how to ignore some map files?

查看:46
本文介绍了作曲家-如何忽略某些地图文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PHP项目中使用composer.有一个模块可以将许多文件映射到根目录.其中包括README.mdCHANGELOG.md之类的文件,而generation autolod files会引发错误:

I'm using composer in my PHP project. There is a module which maps lots of files into to root directory. This includes files like README.md and CHANGELOG.md and the generation autolod files throws an error:

[ErrorException]                                                                
Target ./README.md already exists (set extra.magento-force to override)

是否可以选择忽略映射中的文件列表并且不使用替代选项?

Is there a option to ignore a list of files from the mapping and don't use the override option?

推荐答案

例如,如果您想防止pub/.htaccess被覆盖,我就是这样工作的.

I works like this, for example if you want to prevent the pub/.htaccess from being overwritten.

将此添加到composter.json

"extra": {
    "magento-force": "override",
    "magento-deploy-ignore": {
        "*": [
            "/pub/.htaccess"
        ]
    }
}

有关更多信息,请参见此处: https://github.com/magento/magento-composer-installer/blob/master/doc/Deploy.md#prevent-single-files-from-deploy

See here for more information: https://github.com/magento/magento-composer-installer/blob/master/doc/Deploy.md#prevent-single-files-from-deploy

备注:在升级Magento版本(2.2.4-> 2.2.5)时,此类文件似乎仍被删除,因此您必须从VCS还原它们

Remark: On upgrading Magento versions (2.2.4 -> 2.2.5) such files still seem to be deleted, so you have to restore them from the VCS

这篇关于作曲家-如何忽略某些地图文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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