PHP Composer: No Dev Mode that Sticks

前端 未结 2 1766
暖寄归人
暖寄归人 2021-01-07 18:52

When you install or update a project with composer, you can tell it to skip the development related dependencies (tests, build tools, etc.) with th

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-07 19:54

    In short: no - not, yet.

    Composer's default installation mode is to install development dependencies.

    As far as i know, there is only the CLI option --no-dev and no config option.

    It's possible to define a config section in the composer.json of a project, see https://getcomposer.org/doc/04-schema.md#config

    But a quick glance at the source code revealed, that there is no configuration directive for this. https://github.com/composer/composer/blob/master/src/Composer/Config.php#L22

    {
        "config": {
            "no-dev": "true"
        }
    }
    

    +1 for this idea. It could be a useful addition to the Config class.

提交回复
热议问题