karnokrat
karnokrat

Reputation: 25

How to stop wasting time updating dependencies with composer?

I am building a small app with some dependencies and my back-end is in PHP with composer and I use many dependencies.

I used to keep the project up-to-date but sometimes, composer update is just to long!

Anyone have some good tips to help me updating my dependencies? any automated service that can run them for me without breaking my code?

Upvotes: 0

Views: 1141

Answers (3)

Jerry
Jerry

Reputation: 666

I use prestissimo for a much faster composer update/install process. It's a composer plugin aka composer global require hirak/prestissimo and you are done.

It downloads all ur packages simultaneously and installs them!

This will make composer insanely fast.

Benchmark on a Laravel install without prestissimo 288s => with prestissimo 26s!!!

For automating ur Process you could set up a cronjob and let it run a bash script with something like this inside:

Filename in example = composer_update.sh. Content:

#!/bin/bash

composer update --no-progress --profile --prefer-stable

For not breaking ur code I recommend setting a minimum stability in ur composer.json

The cronjob for updating once a month could look like this

*/0 0 1 * * /PROJECT_ROOT/composer_update.sh >> update.log

This article might further help you with cron.

Hope I could help you.

Upvotes: 2

greysteil
greysteil

Reputation: 906

I built Dependabot to do exactly this. Every morning it will check with packagist whether there are any new versions, and if there are it will create a pull request to update you to the latest and greatest.

The core of the app is open source here and it's relatively popular with Ruby and JavaScript programmers. The PHP beta is fully functional, and I'm looking for more people to give it a try!

Upvotes: 4

laport_w
laport_w

Reputation: 1

I heard a currently work in progress project wanted to solve this issue.

They link to your github account (you must have one in order for this to work) they want to keep your libraries up-to-date if you're using composer, npm or gem I think.

The thing is, they create a pull-request showing you what will be updated and show you the changelog if there is one for the update.

Take a look at upgator.io

Upvotes: 0

Related Questions