Automation 如何强制composer自动忽略warrning?
我正在制作shell脚本,它将自动在ubuntu上安装symfony4。因为我使用的是apache,所以我必须执行:Automation 如何强制composer自动忽略warrning?,automation,composer-php,Automation,Composer Php,我正在制作shell脚本,它将自动在ubuntu上安装symfony4。因为我使用的是apache,所以我必须执行: composer require symfony/apache-pack 但是,该命令要求我确认: composer require symfony/apache-pack The recipe for this package comes from the "contrib" repository, which is open to community contributi
composer require symfony/apache-pack
但是,该命令要求我确认:
composer require symfony/apache-pack
The recipe for this package comes from the "contrib" repository, which is open to community contributions.
Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/symfony/apache-pack/1.0
Do you want to execute this recipe?
[y] Yes
[n] No
[a] Yes for all packages, only for the current installation session
[p] Yes permanently, never ask again for this project
(defaults to n): y
我不能使用
--没有交互
选项,因为默认值是“n”。如何更改此命令,使其不要求我确认此操作,而是自动安装此apache软件包?这本身并不能回答问题,但如果将以下内容添加到composer.json中,您可以消除每个项目的特定警告:
"extra": {
"symfony": {
"allow-contrib": true
}
}
或者,更好的是,您可以在安装symfony/apache-pack
之前使用Composer本身设置标志:
composer config extra.symfony.allow-contrib true
这将使Flex能够自动安装contrib配方(即社区提供的配方),而无需请求许可。如果我可以通过console命令设置该参数,这将解决问题。有可能吗?是的,这很有效。谢谢也许不是我想象的那样,但肯定解决了我的问题。我很高兴它帮了我的忙!