作曲家| laravel 5-更新依赖关系,但框架本身 [英] composer | laravel 5 - Updating dependencies but the framework itself

查看:160
本文介绍了作曲家| laravel 5-更新依赖关系,但框架本身的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的项目使用Laravel 5的beta版.

I am using pre-beta release of Laravel 5 for my project.

我发现Laravel 5的应用程序框架在github存储库中已更改,并且由于它是开发版本,因此预计会经常更改.

I found out that the app skeleton of Laravel 5 was changed in the github repo and since it is a development version, that is expected to change quite frequently.

我的问题是,我可以仅使用composer而不是框架本身来更新特定的依赖项吗?这样,在我准备进行更改之前,我不必担心更改的应用程序结构吗?

My question is, can I update only the specific dependencies using composer and not the framework itself? So that I don't have to worry about the changing app structure until I am ready to make changes?

这是composer.json依赖项的外观:

Here is how the composer.json dependencies look:

    "require": {
        "laravel/framework": "~5.0"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "way/generators": "~3.0",
        "fzaninotto/faker": "~1.5@dev"
    },

谢谢.

推荐答案

虽然composer update package package ...答案很不错,但您可能能够做的另一件事是将Laravel需求规范更改为特定的提交. Composer文档提到了如何做到这一点,而我已经做到了我自己在一个项目中(尽管不是与laravel一起使用,但在我自己的软件包中也处于Breaking/dev状态).

While the composer update package package ... answer is a good one, another thing you might be able to do is change your Laravel require spec to a specific commit. The Composer documentation mentions how to do this, and I've done it myself on a project (though not with laravel, on my own packages which are also in a breaking/dev state).

"require": {
    "laravel/framework": "dev-master#49e3c77b518547bb661b1de4fda64a3ae0c5c505",
    ...
}

我希望,因为laravel/framework'替换'了各种illuminate/*软件包,所以只要不依赖于这些软件包(只要规格为5.0式),就可以在不下载有启发性的软件包的情况下工作两次.

I'd hope that, because laravel/framework 'replaces' the various illuminate/* packages, that any reliance on these (as long as the spec is 5.0-esque) that this would work without downloading the illuminate packages twice.

通过这种方式,您可以在给定提交时锁定您的laravel/framework(或任何软件包),但仍允许标准composer update正常工作.

Doing it this way you can lock your laravel/framework (or any package) at a given commit, but still allow the standard composer update to work.

要找出您已经提交的内容,如果您的laravel/framework依赖规范是开发人员,则vendor/laravel/framework/目录本身应该是git repo,因此只需在其中执行git status即可获得HEAD.参考或者,在composer.lock中查找laravel/framework条目的source.reference值.

To find out what commit you're already on, if your laravel/framework dependency spec is a dev one then the vendor/laravel/framework/ directory itself should be a git repo, so just do git status in there to get the HEAD ref. Alternatively, look in composer.lock for the laravel/framework entry's source.reference value.

这篇关于作曲家| laravel 5-更新依赖关系,但框架本身的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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