如何在composer.json中使用Laravel 4.2的分叉版本?

时间:2016-11-04 00:40:36

标签: php laravel composer-php

我分叉了laravel / framework'库进入我自己的Github帐户,并在4.2分支上做了一个小改动。这是我的版本的链接:

https://github.com/flyingL123/framework/tree/4.2

我按照作曲家网站上的说明更新composer.json:

"require": {
    "laravel/framework": "4.2.x-dev"
},
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/flyingL123/framework"
    } 
]

当我运行composer update laravel/framework时,我收到以下错误:

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
    - Conclusion: don't install laravel/framework 4.2.x-dev
    - Conclusion: remove symfony/browser-kit v2.5.11
    - Installation request for laravel/framework 4.2.x-dev -> satisfiable by laravel/framework[4.2.x-dev].
    - Conclusion: don't install symfony/browser-kit v2.5.11
    - laravel/framework 4.2.x-dev requires symfony/browser-kit 2.7.* -> satisfiable by symfony/browser-kit[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.20, v2.7.3, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
    - Can only install one of: symfony/browser-kit[v2.7.0, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.1, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.10, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.11, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.12, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.13, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.14, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.15, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.16, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.17, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.18, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.19, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.2, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.20, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.3, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.4, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.5, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.6, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.7, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.8, v2.5.11].
    - Can only install one of: symfony/browser-kit[v2.7.9, v2.5.11].
    - Installation request for symfony/browser-kit (locked at v2.5.11) -> satisfiable by symfony/browser-kit[v2.5.11].

如果我将composer.json恢复到原始状态,请使用:

"require": {
    "laravel/framework": "4.2.*@dev"
}

一切都按预期安装得很好。为什么我的分叉版本安装不正确?我唯一改变的是其中一个Eloquent文件中的几行。

1 个答案:

答案 0 :(得分:0)

我似乎已经通过运行composer update laravel/framework --with-dependencies修复了它。

我最好的猜测是--with-dependencies确保卸载了框架依赖项,然后使用正确的版本重新安装。我不确定为什么这是必要的,但似乎有效。