如何在项目中使用laravel叉?

发布于 2025-02-05 16:36:55 字数 1936 浏览 2 评论 0原文

从前,我决定为Laravel框架做出贡献。我分叉了,创建了新的分支,编写了功能,然后我想测试我的功能,因此我创建了一个空的Laravel项目,在这里我被卡住了。

我更改了composer.json这样

    ...
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/trckster/framework"
        }
    ],
    "require": {
        ...
        "laravel/framework": "dev-feat/show-fields-difference-for-similar-results",
        ...
    },
    ...

,然后我运行Composer Update,作曲家说我错了,

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

  Problem 1
    - illuminate/support[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.0.19) does not satisfy that requirement.
    - illuminate/support[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.0.19) does not satisfy that requirement.
    - illuminate/support[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.0.19) does not satisfy that requirement.
    - Root composer.json requires laravel/framework dev-feat/show-fields-difference-for-similar-results -> satisfiable by laravel/framework[dev-feat/show-fields-difference-for-similar-results].
    - laravel/tinker[v2.7.0, ..., 2.x-dev] require illuminate/support ^6.0|^7.0|^8.0|^9.0 -> satisfiable by illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev].
    - Only one of these can be installed: illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev], laravel/framework[dev-feat/show-fields-difference-for-similar-results]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
    - Root composer.json requires laravel/tinker ^2.7 -> satisfiable by laravel/tinker[v2.7.0, v2.7.1, v2.7.2, 2.x-dev].

很明显问题是依赖关系,但是我不知道该怎么办有了这些东西,最后测试了我的功能。

Once upon a time I decided to contribute Laravel framework. I forked it, created new branch, wrote feature, then I wanted to test my feature, so I created an empty Laravel project, and here I got stuck.

I changed composer.json like this

    ...
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/trckster/framework"
        }
    ],
    "require": {
        ...
        "laravel/framework": "dev-feat/show-fields-difference-for-similar-results",
        ...
    },
    ...

Then I ran composer update and composer said I'm wrong

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

  Problem 1
    - illuminate/support[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.0.19) does not satisfy that requirement.
    - illuminate/support[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.0.19) does not satisfy that requirement.
    - illuminate/support[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.0.19) does not satisfy that requirement.
    - Root composer.json requires laravel/framework dev-feat/show-fields-difference-for-similar-results -> satisfiable by laravel/framework[dev-feat/show-fields-difference-for-similar-results].
    - laravel/tinker[v2.7.0, ..., 2.x-dev] require illuminate/support ^6.0|^7.0|^8.0|^9.0 -> satisfiable by illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev].
    - Only one of these can be installed: illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev], laravel/framework[dev-feat/show-fields-difference-for-similar-results]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
    - Root composer.json requires laravel/tinker ^2.7 -> satisfiable by laravel/tinker[v2.7.0, v2.7.1, v2.7.2, 2.x-dev].

It was obvious that problem was in dependencies, but I had no idea what to do with this stuff and finally test my feature.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾听心声的旋律 2025-02-12 16:36:55

几周后,我回到了这个问题,开始在互联网中搜索信息,并找到有用的文章,描述了类似的问题和解决方案的方法:

现在我们可以调整叉子的作曲家。

基本上,我要做的就是更改composer.json中的一行

-    "laravel/framework": "dev-feat/show-fields-difference-for-similar-results",
+    "laravel/framework": "dev-feat/show-fields-difference-for-similar-results as 9.11",

,它有效,COMPOSER UPDATE从我的Github下载了叉子版本。
希望这个自我解决的问题有帮助!

After a few weeks I returned to this problem and started searching information in the Internet and found useful article, there was described similar problem and way to solve it:

Now we can adjust our fork’s composer.json requirement and tell it to treat our custom branch as v2.4.5 like so.

Basically, all I needed to do is change one line in composer.json

-    "laravel/framework": "dev-feat/show-fields-difference-for-similar-results",
+    "laravel/framework": "dev-feat/show-fields-difference-for-similar-results as 9.11",

And it worked, composer update downloaded forked version from my github.
Hope this self-answered question was helpful!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文