2015-07-04 156 views
1

,而試圖通過作曲家在Ubuntu上安裝聯賽/ OAuth2用戶的客戶端與最新的捲曲和OpenSSL庫與最新的PHP版本相結合,我得到一個錯誤安裝聯賽/ OAuth2用戶的客戶端:如何通過作曲家

$ composer require league/oauth2-client 
Using version ^0.12.1 for league/oauth2-client 
./composer.json has been updated 
Loading composer repositories with package information 
Updating dependencies (including require-dev) 
Your requirements could not be resolved to an installable set of packages. 

Problem 1 
- Installation request for league/oauth2-client 1.0.x-dev -> satisfiable by league/oauth2-client[1.0.x-dev]. 
- Can only install one of: league/oauth2-client[0.12.1, 1.0.x-dev]. 
- Installation request for league/oauth2-client ^0.12.1 -> satisfiable by league/oauth2-client[0.12.1]. 

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

到目前爲止找不到任何提示。提前感謝您的支持!

composer.json

$ cat composer.json 
{ 
    "name": "league/oauth2-client", 
    "description": "OAuth 2.0 Client Library", 
    "license": "MIT", 
    "require": { 
     "php": ">=5.5.0", 
     "ext-curl": "*", 
     "ircmaxell/random-lib": "~1.1", 
     "guzzlehttp/guzzle": "~6.0" 
    }, 
    "require-dev": { 
     "phpunit/phpunit": "~4.0", 
     "mockery/mockery": "~0.9", 
     "squizlabs/php_codesniffer": "~2.0", 
     "satooshi/php-coveralls": "0.6.*", 
     "jakub-onderka/php-parallel-lint": "0.8.*" 
    }, 
    "keywords": [ 
     "oauth", 
     "oauth2", 
     "authorization", 
     "authentication", 
     "idp", 
     "identity", 
     "sso", 
     "single sign on" 
    ], 
    "authors": [ 
     { 
      "name": "Alex Bilbie", 
      "email": "[email protected]", 
      "homepage": "http://www.alexbilbie.com", 
      "role": "Developer" 
     } 
    ], 
    "autoload": { 
     "psr-4": { 
      "League\\OAuth2\\Client\\": "src/" 
     } 
    }, 
    "autoload-dev": { 
     "psr-4": { 
      "League\\OAuth2\\Client\\Test\\": "test/src/" 
     } 
    }, 
    "extra": { 
     "branch-alias": { 
      "dev-master": "1.0.x-dev" 
     } 
    } 
} 
+0

你是什麼composer.json的內容? – TheGeorgeous

+0

這是一個標準安裝,剛剛檢查出git repo – merlin

回答

0

的教改嘗試,我認爲你正在使用的作曲家錯誤。嘗試運行composer install

從作曲家文檔:

的要求命令從 當前目錄中增加了新的軟件包到composer.json文件。如果沒有文件存在,將在 飛行中創建一個文件。

安裝命令從當前的 目錄中讀取composer.json文件,解析相關性並將其安裝到供應商。

所以如果composer.json是聯盟/ OAuth2用戶的客戶端,只需運行composer install

如果你想加入聯盟/ OAuth2用戶的客戶端至於其它的一些軟件包的依賴關係,運行composer require league/oauth2-client

+0

謝謝。工作!我不明白爲什麼自述文件另有說明:https://github.com/thephpleague/oauth2-client安裝 Via Composer $ composer require league/oauth2-client – merlin

+0

通常情況下,您不會使用oauth2-client單獨。我將成爲應用程序的一部分,因此也是依賴項。我認爲這是作者的意思 – TheGeorgeous

0

我已經修復了第一次安裝knpuniversity/oauth2-client-bundle。所以,你需要按照這個順序:

composer require knpuniversity/oauth2-client-bundle 
composer require league/oauth2-client 
composer require league/oauth2-facebook 

這是在安裝後,我的composer.json文件:

{ 
"knpuniversity/oauth2-client-bundle": "^1.9", 
"league/oauth2-client": "^2.2", 
"league/oauth2-facebook": "^2.0" 
} 

希望它可以幫助