PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 29, 2022

[FIXED] composer | laravel 5 - Updating dependencies but the framework itself

 January 29, 2022     composer-php, laravel, laravel-4, laravel-5     No comments   

Issue

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.


Solution

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.



Answered By - alexrussell
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing