1

SF2 プロジェクトにパッケージ phpdocumentor/reflexion をインストールしたいと考えています。したがって、次のコマンドを実行しますcomposer require "phpdocumentor/reflection"が、次のスタック エラーが発生します。

 Your requirements could not be resolved to an installable set of packages.

Problem 1

- Conclusion: don't install phpdocumentor/reflection 3.0.1
- Conclusion: remove phpdocumentor/reflection-docblock 3.1.1
- Installation request for phpdocumentor/reflection ^3.0 -> satisfiable by phpdocumentor/reflection[3.0.0, 3.0.1].                                                                                                │  Feature/T4136-18-identification-by-vin
- Conclusion: don't install phpdocumentor/reflection-docblock 3.1.1
- phpdocumentor/reflection 3.0.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.0a1, 2.0.0a2, 2.0.0a3, 2.0.1, 2.0.2, 2.0.3, 2.0.4].               │  master
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0a1, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0a2, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0a3, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.1, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.2, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.3, 3.1.1].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.4, 3.1.1].
- Installation request for phpdocumentor/reflection-docblock (locked at 3.1.1) -> satisfiable by phpdocumentor/reflection-docblock[3.1.1].

これが私のものcomposer.jsonです:

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "2.8.*",
    "symfony/serializer": "~3.1.5",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0"
},
"require-dev": {
    "sensio/generator-bundle": "~3.0",
    "symfony/phpunit-bridge": "~2.7",
    "phpunit/phpunit": "5.5.*"
},
"scripts": {
    "symfony-scripts": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-install-cmd": [
        "@symfony-scripts"
    ],
    "post-update-cmd": [
        "@symfony-scripts"
    ]
},
"config": {
    "bin-dir": "bin",
    "platform": {
        "php": "5.6"
    }
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.8-dev"
    }
}

}

どこに問題があるのか​​正確にはわかりませんが、composer は phpdocumentor/reflection (3.0.1) の最新の安定バージョンをインストールしようとしていると思います。このパッケージは phpdocumentor/reflection-docblock (~2.0) に依存していますが、3.1.1 である必要があります。

この問題を解決する方法はありますか?

4

2 に答える 2

5

必要なphpdocumentor/reflection ~3.0パッケージをインストールする場合は、 . 問題は、が必要なため、既にインストールされていることです。 phpdocumentor/reflection-docblock ~2.0phpdocumentor/reflection-docblock ~3.1phpspec/prophecy 1.6.1phpdocumentor/reflection-docblock (^2.0|^3.0.2)

良いニュースはphpspec/prophecy、 ~2.0 バージョンのphpdocumentor/reflection-docblockで問題なく動作するため、最初にそのパッケージをダウングレードできることです。

composer require phpdocumentor/reflection-docblock:~2.0

次に、phpdocumentor/reflection競合なしで要求できます。

composer require phpdocumentor/reflection
于 2016-11-14T16:23:34.907 に答える
1

phpdocumentor/reflection-docblock 3.1.1 がすでにインストールされているようで、このパッケージには phpdocumentor/reflection-docblock 3.0.* が必要です。

phpdocumentor/reflection-docblock 3.1.1 を削除し、phpdocumentor/reflexion を再度インストールしてみてください

于 2016-11-14T15:42:20.407 に答える