3

に次のブロックがある Symfony v4.4 (Flex) プロジェクトがあるとしますcomposer.json

"extra": {
    "symfony": {
        "allow-contrib": false,
        "require": "4.4.*"
    }
}

予想どおり、Symfony コア パッケージがそのv4.4バージョンに固執するように制限します。

symfony/monolog-bridgesymfony/monolog-bridge ~4.3.0パッケージはそれを尊重するため、またはをインストールすることはできません^5.0

それでもsymfony/monolog-bundle ~3.5.0、コア Symfony フレームワークの一部ではなく、独自の独立したリリースおよびバージョン管理サイクルを持つ単なるバンドルであることを考えると、これも期待どおりにインストールできます。

私が理解できないのは、コンポーザーが区別するのに役立つものは何ですか?これらのパッケージのどれが Symfony コアパッケージであり、extra.symfony.require制限が適用され、どれが適用されていないのですか?

typeそれを可能にしたのは作曲家の特性だと当初は思っていましたが、symfony-bridgeタイプがユニークであるという痕跡は見当たりません。そうであれば、ソースコードまたはドキュメントへのリンクは非常に役立ちます。

更新日:

デフォルトの Symfony (Flex を使用) v4.4 composer.json:

{
    "name": "symfony/website-skeleton",
    "type": "project",
    "license": "MIT",
    "description": "A skeleton to start a new Symfony website",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "sensio/framework-extra-bundle": "^5.1",
        "symfony/asset": "*",
        "symfony/console": "*",
        "symfony/dotenv": "*",
        "symfony/expression-language": "*",
        "symfony/flex": "^1.3.1",
        "symfony/form": "*",
        "symfony/framework-bundle": "*",
        "symfony/http-client": "*",
        "symfony/intl": "*",
        "symfony/mailer": "*",
        "symfony/monolog-bundle": "^3.1",
        "symfony/orm-pack": "*",
        "symfony/process": "*",
        "symfony/security-bundle": "*",
        "symfony/serializer-pack": "*",
        "symfony/translation": "*",
        "symfony/twig-pack": "*",
        "symfony/validator": "*",
        "symfony/web-link": "*",
        "symfony/yaml": "*"
    },
    "require-dev": {
        "symfony/debug-pack": "*",
        "symfony/maker-bundle": "^1.0",
        "symfony/profiler-pack": "*",
        "symfony/test-pack": "*"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.4.*"
        }
    }
}

"symfony/monolog-bridge": "^5.0"依存関係を追加するとcomposer update

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.4.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package symfony/monolog-bridge ^5.0 exists as symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these are rejected by your constraint.
  Problem 2
    - symfony/monolog-bundle v3.5.0 requires symfony/monolog-bridge ~3.4 || ~4.0 || ^5.0 -> satisfiable by symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these conflict with your requirements or minimum-stability.
    - symfony/monolog-bundle v3.5.0 requires symfony/monolog-bridge ~3.4 || ~4.0 || ^5.0 -> satisfiable by symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these conflict with your requirements or minimum-stability.
    - symfony/monolog-bundle v3.4.0 requires symfony/monolog-bridge ~3.4|~4.0 -> satisfiable by symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these conflict with your requirements or minimum-stability.
    - symfony/monolog-bundle v3.3.1 requires symfony/monolog-bridge ~2.7|~3.3|~4.0 -> satisfiable by symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these conflict with your requirements or minimum-stability.
    - symfony/monolog-bundle v3.3.0 requires symfony/monolog-bridge ~2.7|~3.3|~4.0 -> satisfiable by symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these conflict with your requirements or minimum-stability.
    - symfony/monolog-bundle v3.2.0 requires symfony/monolog-bridge ~2.7|~3.0|~4.0 -> satisfiable by symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these conflict with your requirements or minimum-stability.
    - symfony/monolog-bundle v3.1.2 requires symfony/monolog-bridge ~2.7|~3.0|~4.0 -> satisfiable by symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these conflict with your requirements or minimum-stability.
    - symfony/monolog-bundle v3.1.1 requires symfony/monolog-bridge ~2.7|~3.0|~4.0 -> satisfiable by symfony/monolog-bridge[4.4.x-dev, v4.4.0, v4.4.0-BETA1, v4.4.0-BETA2, v4.4.0-RC1, v4.4.1] but these conflict with your requirements or minimum-stability.
    - symfony/monolog-bundle v3.1.0 requires symfony/monolog-bridge ~2.7|~3.0 -> no matching package found.
    - Installation request for symfony/monolog-bundle ^3.1 -> satisfiable by symfony/monolog-bundle[v3.1.0, v3.1.1, v3.1.2, v3.2.0, v3.3.0, v3.3.1, v3.4.0, v3.5.0].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

疑問が残ります - パッケージが v4.4 によって制限されるべきであることを symfony がどのように認識しているか

4

1 に答える 1