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:没有固定的开发模式
基础教程推荐
- 如何替换eregi() 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
