PHP Composer:没有固定的开发模式

PHP Composer: No Dev Mode that Sticks(PHP Composer:没有固定的开发模式)
本文介绍了PHP Composer:没有固定的开发模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您使用 composer installupdate 项目时,您可以使用 告诉它跳过与开发相关的依赖项(测试、构建工具等)>--no-dev 标志

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

composer.phar update --no-dev

没有这个标志,composer 将始终下载额外的依赖项.

Without this flag, composer will always download the extra dependencies.

有没有办法(以编程方式或其他方式)告诉作曲家总是跳过开发依赖项?也就是说,有没有什么真实的代码可以匹配伪代码

Is there any way (programmatically or otherwise) to tell composer to always skip the development dependencies? That is, is there anything real code that matches the pseudo code

//File: composer.json
//...
"no-dev":"true"
//...

推荐答案

简而言之:没有 - 还没有.

In short: no - not, yet.

Composer默认的安装方式是安装开发依赖.

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

据我所知,只有 CLI 选项 --no-dev 而没有配置选项.

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

可以在项目的 composer.json 中定义配置部分,请参阅 https://getcomposer.org/doc/04-schema.md#config

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

但是快速浏览一下源代码就会发现,没有配置指令.https://github.com/composer/composer/blob/master/src/作曲家/Config.php#L22

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 支持这个想法.它可能是对 Config 类的有用补充.

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

这篇关于PHP Composer:没有固定的开发模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)