作曲家无法解析hwi/oauth-bundle的依赖项 [英] composer could not resolve dependencies for hwi/oauth-bundle

查看:108
本文介绍了作曲家无法解析hwi/oauth-bundle的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我执行$ composer require hwi/oauth-bundle,我会得到:

If I do $ composer require hwi/oauth-bundle I get this:

Using version ^0.6.3 for hwi/oauth-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.2.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for hwi/oauth-bundle ^0.6.3 -> satisfiable by hwi/oauth-bundle[0.6.3].
    - hwi/oauth-bundle 0.6.3 requires php-http/client-implementation ^1.0 -> satisfiable by php-http/guzzle6-adapter[v2.0.1].
    - hwi/oauth-bundle 0.6.3 requires php-http/httplug ^1.0 -> satisfiable by php-http/httplug[v1.0.0, v1.1.0].
    - Can only install one of: php-http/httplug[v2.0.0, v1.0.0].
    - Can only install one of: php-http/httplug[v2.0.0, v1.1.0].
    - php-http/guzzle6-adapter v2.0.1 requires php-http/httplug ^2.0 -> satisfiable by php-http/httplug[v2.0.0].
    - Conclusion: remove php-http/httplug v2.0.0

Installation failed, reverting ./composer.json to its original content.

我的PHP版本是:

$ php --version
PHP 7.2.15-0ubuntu0.18.04.2 (cli) (built: Mar 22 2019 17:05:14) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies

这是我当前的composer.json:

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "sensio/framework-extra-bundle": "^5.1",
        "symfony/apache-pack": "^1.0",
        "symfony/asset": "4.2.*",
        "symfony/console": "4.2.*",
        "symfony/dotenv": "4.2.*",
        "symfony/expression-language": "4.2.*",
        "symfony/flex": "^1.1",
        "symfony/form": "4.2.*",
        "symfony/framework-bundle": "4.2.*",
        "symfony/monolog-bundle": "^3.1",
        "symfony/orm-pack": "*",
        "symfony/process": "4.2.*",
        "symfony/security-bundle": "4.2.*",
        "symfony/serializer-pack": "*",
        "symfony/swiftmailer-bundle": "^3.1",
        "symfony/translation": "4.2.*",
        "symfony/twig-bundle": "4.2.*",
        "symfony/validator": "4.2.*",
        "symfony/web-link": "4.2.*",
        "symfony/webpack-encore-bundle": "^1.4",
        "symfony/yaml": "4.2.*"
    },
    "require-dev": {
        "symfony/debug-pack": "*",
        "symfony/maker-bundle": "^1.0",
        "symfony/profiler-pack": "*",
        "symfony/test-pack": "*",
        "symfony/web-server-bundle": "4.2.*"
    },
    "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.2.*"
        }
    }
}

我的symfony版本是:

My symfony version is:

$ php bin/console --version
Symfony 4.2.4 (env: dev, debug: true)

问题

如何在SF v4.2.4和PHP v7.2.15中安装hwi/oauth-bundle?

Question

How can I install hwi/oauth-bundle in a SF v4.2.4 and with PHP v7.2.15?

推荐答案

这是一个骗子: Luc添加此选项的答案对我来说很好

The answer of Luc of adding this worked fine for me

"hwi/oauth-bundle": "^0.6.3",
"php-http/guzzle6-adapter": "~1.1.1",
"php-http/httplug-bundle": "~1.13"

事实上,我所做的是在命令行中通过以下命令要求它们:

In fact what I did is requiring them from the command line with this command:

composer require "hwi/oauth-bundle:^0.6.3" "php-http/guzzle6-adapter:~1.1.1" "php-http/httplug-bundle:~1.13"

然后当被问到Do you want to execute this recipe?(两次,一次是hwi/oauth-bundle,另一次是php-http/httplug-bundle)时,我所做的是告诉n并从此处手动遵循配方:

Then when asked Do you want to execute this recipe? (twice, one for hwi/oauth-bundle and the other for php-http/httplug-bundle) what I did is to tell n and follow the recipe manually from here: https://github.com/symfony/recipes-contrib/tree/master/hwi/oauth-bundle/0.6

我在此处 https://github.com/symfony/recipes-contrib/blob/master/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml

I added the routing file (import of routing) here https://github.com/symfony/recipes-contrib/blob/master/hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml and the package file (configuration) here https://github.com/symfony/recipes-contrib/blob/master/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml

然后我添加了用于修改bundles.php的捆绑包,然后最终在配方根目录中使用了manifest.jsonpost-install.txt来帮助我进行良好的配置(包括我必须更改的.env建议)不想使用Facebook,但不想使用Facebook.

Then I added the bundles modifying my bundles.php and then finally used the manifest.json and post-install.txt in the recipe root to help me have a nice configuration (including the .env suggestion which I had to change as I did not want to use Facebook but Google's one.

与此处的食谱相同 https://Http.pl的//github.com/symfony/recipes-contrib/tree/master/php-http/httplug-bundle/1.6 .刚刚添加了软件包配置文件.

Same with the recipe here https://github.com/symfony/recipes-contrib/tree/master/php-http/httplug-bundle/1.6 for the HttpPlug. Just added the package config file.

这篇关于作曲家无法解析hwi/oauth-bundle的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆