aoe/composer-satis-builder

此包已被废弃,不再维护。未建议替代包。

是 Satis 的补充工具,用于从项目的 composer.json 更新 satis.json 的 'require' 键。

dev-master 2016-04-19 05:34 UTC

This package is auto-updated.

Last update: 2022-09-15 22:52:10 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
    [-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": "http://localhost: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": "http://localhost:7777/"
        }
    ]
}

并且已安装 Composer Satis Builder

php composer.phar create-project aoe/composer-satis-builder --stability=dev

运行后

php composer-satis-builder/bin/composer-satis-builder build composer.json satis.json --reset-requirements --add-requirements

satis.json 将看起来像

{
    "name": "My Repository",
    "homepage": "http://localhost: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 文件以获取详细信息