0

我有一个很大的 Symfony 项目并开始将代码外包给独立的包。这就像魅力一样。

但我已经意识到 composer.json 在执行作曲家更新后在根级别包含“奇怪”的信息:

这就是我要求的原因:

    "customer/base-bundle": {
        "version": "dev-develop"
    },
    "customer/a-bundle": {
        "version": "dev-develop"
    },
    "customer/b-bundle": {
        "version": "dev-develop"
    },
    "customer/c-bundle": {
        "version": "dev-develop"
    },
    "symfony/polyfill-intl-idn": {
        "version": "v1.11.0"
    },

这是 composer.json 中的常规配置:

    "repositories": {
        "base-bundle": {
            "type": "vcs",
            "url": "git@git.example.com:customer-shared/base-bundle.git"
        },
        "a-bundle": {
            "type": "vcs",
            "url": "git@git.example.com:customer-shared/a-bundle.git"
        },
        "b-bundle": {
            "type": "vcs",
            "url": "git@git.example.com:customer-shared/b-bundle.git"
        },
        "c-bundle": {
            "type": "vcs",
            "url": "git@git.pixelpark.com:customer-shared/c-bundle.git"
        }
    },
    "require": {
        // ...
        "customer/base-bundle": "dev-develop",
        "customer/a-bundle": "dev-develop",
        "customer/b-bundle": "dev-develop",
        "customer/c-bundle": "dev-develop"
    }

存储库和要求部分很好。我只是不知道为什么它将“dev-develop”包(和 symfony/polyfill-intl-idn 包)分别添加到 composer.json 的根目录。

这是 Symfony/Flex 行为还是 Composer 的默认行为?这些额外的信息用于什么目的?

提前致谢!

4

1 回答 1

1

当您以这种方式重命名 composer.json 时,它发现存在一个错误:composer-dev.json

Symfony Flex 的 symfony.lock 文件有一个 str_replace。

但是以这种方式重命名自定义composer.json:dev-composer.json有效。

于 2019-06-22T21:34:02.633 回答