no-response-mate / composer-integration-plugin
快速切换集成依赖项
0.3.0
2022-11-10 15:02 UTC
Requires
- php: ^8.0
- composer-plugin-api: ^2.0
Requires (Dev)
- composer/composer: ^2.0
- phpstan/phpstan: ^1.5.4
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^4.19
This package is not auto-updated.
Last update: 2024-09-23 15:46:07 UTC
README
快速切换集成依赖项
安装
composer require --dev sylius-labs/composer-integration-plugin
将此插件添加到允许的插件列表中
"config": { "allow-plugins": { "sylius-labs/composer-integration-plugin": true } },
配置
基本集成配置
"extra": { "integration": { "my-integration": { "require": { "league/uri": "^6", "psr/http-factory": "^1" } } } }
如果你使用 .env 文件,可以自定义 APP_ENV
变量
"extra": { "integration": { "my-integration": { ... "env": "my-integration-special-environment" } } }
如果你的 .env 文件位于项目根目录之外,你可以使用 integration-options.env-path
节点指向其位置
"extra": { "integration-options": { "env-path": "public/app/env/" }, "integration": { "my-integration": { ... "env": "my-integration-special-environment" } } }
env-directory
节点接受相对于当前工作目录的路径(通常是项目根目录)。
用法
配置好集成后,你可以通过运行以下命令在它们之间切换:
composer integration my-integration
要返回到基本的 composer 依赖项,只需运行
composer install
默认情况下,在安装集成时不执行任何脚本,如果你希望启用它们,请使用 with-scripts
选项
composer integration my-integration --with-scripts
该插件内部使用 install
命令,因此只会运行相关脚本。