lucklrj / composer-satis-builder
是Satis的补充工具,用于从项目的composer.json更新satis.json中的'require'键。
0.0.7
2020-05-09 05:51 UTC
Requires
- php: >=5.5.0
- symfony/console: 2.7.*
Requires (Dev)
- phpunit/phpunit: 4.7.*
This package is auto-updated.
Last update: 2024-09-09 15:36:38 UTC
README
是Satis的补充工具,用于从项目的composer.json更新satis.json中的"require"键。
如果您正在镜像git仓库和包压缩文件(dist文件),这特别有用。
问题描述
如果您在satis.json中使用"require-all": true,您将拥有您定义的仓库中所有包的所有版本,这可能会占用大量磁盘空间
或者
您可以选择手动维护"require"键,如果您有很多包,这可能会很耗时。
用法
build
<composer> Path to the project composer.json file
<satis> Path to the satis.json configuration file
[-rdd|--require-dev-dependencies REQUIRE-DEV-DEPENDENCIES] Sets the "require-dev-dependencies" key
[-rd|--require-dependencies REQUIRE-DEPENDENCIES] Sets the "require-dependencies" key
[-rc|--add-requirements] Add the requirements from the project composer.json
[-mc|--merge-requirements] Merge the requirements from the project composer.json
[-drc|--add-dev-requirements] Add the dev requirements from the project composer.json
[-rr|--reset-requirements] Will reset (empty) the satis requirements (require key) before adding the requirements of the composer.json
示例
给定
satis.json
{
"name": "My Repository",
"homepage": "https://:7777",
"repositories": [
{ "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
],
"require": {
}
}
和
composer.json
{
"name": "mycompany/mycompany-project",
"require": {
"mycompany/privaterepo": "^1.3"
},
"repositories": [
{
"packagist": false
},
{
"type": "composer",
"url": "https://:7777/"
}
]
}
并且已安装Composer Satis Builder
php composer.phar create-project lucklrj/composer-satis-builder --stability=dev
运行后
php composer-satis-builder/bin/composer-satis-builder build satis.json composer.json --reset-requirements --add-requirements
satis.json将看起来像
{
"name": "My Repository",
"homepage": "https://:7777",
"repositories": [
{ "type": "vcs", "url": "https://github.com/mycompany/privaterepo" },
],
"require": {
"mycompany/privaterepo": "^1.3"
},
}
现在像以前一样构建Satis
php bin/satis build satis.json web/
许可
Composer Satis Builder根据MIT许可证授权 - 详细信息请参阅LICENSE文件
待办事项
需要支持:^ ~ >= > * 等等。