PHP Composer: No Dev Mode that Sticks(PHP Composer:没有固定的开发模式)
问题描述
当您使用 composer install
或 update
项目时,您可以使用 告诉它跳过与开发相关的依赖项(测试、构建工具等)>--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:没有固定的开发模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP Composer:没有固定的开发模式


- Laravel 仓库 2022-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01