Use Composer CLI to add data to the extra property

痞子三分冷 提交于 2019-12-13 18:38:05

问题


According to the documentation of the extra property of the composer.json schema, allows setting of "arbitrary extra data for consumption by scripts."

For scripting purposes, it would be nice if data can be added to the extra property via the command-line. It have tried composer config extra.foo bar, but this gives the error Setting extra.foo does not exist or is not supported by this command.

So I was wondering: is there a way to use the Composer CLI to add data to the extra property?

UPDATE: Composer 1.1.0 has added supported for this feature: https://getcomposer.org/doc/03-cli.md#modifying-extra-values Unfortunately, it is not possible to add boolean or numeric values, as each value is added as a string. See also issue #5492 of the Composer project.


回答1:


There is no way, and the reason is that this usually is bound to some very specific local use case that does not apply to the general audience.

All parameters that can be influenced with composer config are listed here: https://getcomposer.org/doc/06-config.md

If you want to add data to the "extra" part, you have to edit it by hand or let your script do it in some other way.



来源:https://stackoverflow.com/questions/33568749/use-composer-cli-to-add-data-to-the-extra-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!