在laravel 4上安装goutte

时间:2014-11-09 20:03:49

标签: php laravel laravel-4 composer-php

我想将laravel4-goutte添加到我的laravel 4.2实施中。

我的作曲家文件看起来像这样:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",   
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/everlaat/laravel4-goutte.git"
        }
    ],
    "require": {
        "laravel/framework": "4.2.*",
        "zizaco/confide": "~4.0@dev",
        "zizaco/entrust": "1.2.*@dev",
        "barryvdh/laravel-ide-helper": "1.*",
        "fzaninotto/faker": "1.3.*@dev",
        "bllim/datatables": "~1.3",
        "barryvdh/laravel-debugbar": "~1.7",
        "fabpot/goutte": "v2.0.1",
        "elvedia/goutte": "1.0.*"   
    },
    "require-dev": {
        "way/generators": "~2.6",
        "phpunit/phpunit": "~4.0",
        "mockery/mockery": "~0.9",
        "summerstreet/woodling": "~0.1.6",
        "barryvdh/laravel-ide-helper": "~1.11"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php",
            "app/controllers/admin",
            "app/controllers/user"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd":[
            "php artisan ide-helper:generate"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

但是,在运行composer update时,我得到了:

$ composer update
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
    - elvedia/goutte v1.0.2 requires fabpot/goutte 1.0.*@dev -> no matching pac
age found.
    - elvedia/goutte v1.0.2 requires fabpot/goutte 1.0.*@dev -> no matching pac
age found.
    - Conclusion: remove laravel/framework v4.2.11
    - Conclusion: don't install laravel/framework v4.2.11
    - Conclusion: don't install laravel/framework v4.2.10
    - Conclusion: don't install laravel/framework v4.2.9
    - Conclusion: don't install laravel/framework v4.2.8
    - Conclusion: don't install laravel/framework v4.2.7
    - Conclusion: don't install laravel/framework v4.2.6
    - Conclusion: don't install laravel/framework v4.2.5
    - Conclusion: don't install laravel/framework v4.2.4
    - Conclusion: don't install laravel/framework v4.2.3
    - Conclusion: don't install laravel/framework v4.2.2
    - Conclusion: don't install laravel/framework v4.2.1
    - elvedia/goutte v1.0.1 requires illuminate/support 4.0.x -> satisfiable by
illuminate/support[v4.0.0, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.
.6, v4.0.7, v4.0.8, v4.0.9].
    - elvedia/goutte v1.0.1 requires illuminate/support 4.0.x -> satisfiable by
illuminate/support[v4.0.0, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.
.6, v4.0.7, v4.0.8, v4.0.9].
    - don't install illuminate/support v4.0.0|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.1|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.10|don't install laravel/framework
4.2.0
    - don't install illuminate/support v4.0.2|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.3|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.4|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.5|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.6|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.7|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.8|don't install laravel/framework v
.2.0
    - don't install illuminate/support v4.0.9|don't install laravel/framework v
.2.0
    - Installation request for laravel/framework 4.2.* -> satisfiable by larave
/framework[v4.2.0, v4.2.1, v4.2.10, v4.2.11, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4
2.6, v4.2.7, v4.2.8, v4.2.9].
    - Installation request for elvedia/goutte 1.0.* -> satisfiable by elvedia/g
utte[v1.0.1, v1.0.2].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your mi
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion>
or more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further commo
 problems.

如何将goutte纳入我的laravel 4项目?

感谢您的回答!

1 个答案:

答案 0 :(得分:1)

elvedia/goutte需要fabpot/goutte: 1.0.*@dev。您需要fabpot/goutte: 2.0.1。那两个包冲突了。删除行

"fabpot/goutte": "v2.0.1"

这会将软件包降级到1.0.7,它会正确安装。否则,您必须等待elvedia/goutte包将其依赖关系更新为2.0版本。