nin*_*bon 12 php command-line-interface composer-php
从 Composer 2.2 开始,该设置allow-plugins将是强制性的,我尝试通过composer configCLI 中的命令推送此设置,但没有成功。
我\xe2\x80\x99已经尝试了一些命令,例如:
\ncomposer config --json '{"allow-plugins.composer/installers":true, "allow-plugins.dealerdirect/phpcodesniffer-composer-installer": true, "allow-plugins.roots/wordpress-core-installer": true }'
composer config config.allow-plugins '{"composer/installers":true, "dealerdirect/phpcodesniffer-composer-installer": true, "wordpress-core-installer": true}'
composer config --append "allow-plugins" "composer/installers":true, "dealerdirect/phpcodesniffer-composer-installer": true, "wordpress-core-installer": true
composer config --json "allow-plugins" '{"composer/installers":true, "dealerdirect/phpcodesniffer-composer-installer": true, "roots/wordpress-core-installer": true }'
我收到的只是错误消息,例如“..未定义”或者它是无效值。
\n我所拥有的是这样的:
\n\xe2\x80\x8b "config": {\n "optimize-autoloader": true,\n "preferred-install": "dist"\n},\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\nRun Code Online (Sandbox Code Playgroud)\n而且,我需要添加如下设置:
\n\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b"config": {\n "optimize-autoloader": true,\n "preferred-install": "dist",\n "allow-plugins": {\n "composer/installers": true,\n "dealerdirect/phpcodesniffer-composer-installer": true,\n "roots/wordpress-core-installer": true\n }\n},\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\xe2\x80\x8b\nRun Code Online (Sandbox Code Playgroud)\n这可以通过 CLI 实现吗?
\nyiv*_*ivi 17
您需要将它们一一设置。
composer config allow-plugins.composer/installers true
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer config allow-plugins.roots/wordpress-core-installer true
Run Code Online (Sandbox Code Playgroud)
在评论中编辑每个对话:
OP 希望在命令期间不被提示。为此,我们必须传递--no-interaction(或-n) 选项。这在执行自动化任务时非常有用。
OP 插件的完整示例:
composer config --no-interaction allow-plugins.composer/installerstrue
composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer config --no-interaction allow-plugins.roots/wordpress-core-installer true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16760 次 |
| 最近记录: |