I am using pre-beta release of Laravel 5 for my project.
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.
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?
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"
},
Thank you.
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",
...
}
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.
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.
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.
Composer allows you to do specific package upgrades. I used this literally the other night to upgrade a single package to fix a bug, but I didn't want to change anything else.
composer update <package1> <package2> <...>
So in your case
composer update phpunit/phpunit way/generators fzaninotto/faker
It might be more complicated when you have lots of packages - but it is a solution that works.
Yes, you can simply call
composer update vendor/package
without updating your whole project.
It will work for the packages pulled by yourself and for the dependencies
You can't really. If you use Laravel 5 this is a thing you need to deal with, development versions come with this backdraw.
来源:https://stackoverflow.com/questions/26134943/composer-laravel-5-updating-dependencies-but-the-framework-itself