theofidry / composer-inheritance-plugin
Composer 插件,用于合并多个子 composer.json 文件
v1.2.0
2021-10-11 06:37 UTC
Requires
- php: ^7.2 || ^8.0
- composer-plugin-api: ^1.0 || ^2.0
- wikimedia/composer-merge-plugin: ^2.0
Requires (Dev)
- composer/composer: ^1.0 || ^2.0
Conflicts
- composer/composer: >=2.0,<2.0.13
This package is auto-updated.
Last update: 2024-09-11 12:41:01 UTC
README
是 Wikimedia composer-merge-plugin 的观点性版本,用于与 bamarni/composer-bin-plugin 配对使用。
使用方法
如果您熟悉 bamarni/composer-bin-plugin,您知道可以轻松管理多个命名空间,而不会影响项目依赖。然而,有一个问题:您 vendor-bin
目录中的 composer.json
文件完全与项目根目录的 composer.json
文件隔离。通过 wikimedia/composer-merge-plugin 可以改变这一点。这个库预先配置了这个插件,以便更方便地使用。
实时示例: https://github.com/nelmio/alice
/nelmio-alice-project
├── composer.json <-- uses bamarni/composer-bin-plugin to manage vendor-bin
├── composer.lock
├── vendor/
└── vendor-bin/
├── laravel
| ├── composer.json <-- uses theofidry/composer-inheritance-plugin to
| | inherit from the root `composer.json` and add
| | dependencies related to Laravel to test the
| | Laravel bridge
| ├── composer.lock
| └── vendor/
└── symfony
├── composer.json <-- uses theofidry/composer-inheritance-plugin to
| inherit from the root `composer.json` and add
| dependencies related to Symfony to test the
| Symfony bridge
├── composer.lock
└── vendor/