Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run composer.phar self-update in travis

I am facing warning statements in my travis builds.

Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/home/travis/.phpenv/versions/5.3.26/bin/composer.phar self-update" to get the latest version.

How do I then run this?

See an e.g. here

like image 442
Kim Stacks Avatar asked Sep 28 '13 07:09

Kim Stacks


People also ask

How do I update my composer self update?

To change to version one, run the self-update command and pass in the --1 flag. This will change the composer to version one, and now you can install your dependencies. Once you have installed your dependencies, you can now run the same command and pass in --2 as the flag, which will switch back to composer version 2.

How to update the composer version?

update / u# In order to get the latest versions of the dependencies and to update the composer. lock file, you should use the update command. This command is also aliased as upgrade as it does the same as upgrade does if you are thinking of apt-get or similar package managers.

What is phar in composer?

It is a PHAR (PHP archive), which is an archive format for PHP which can be run on the command line, amongst other things. Now run php composer.phar in order to run Composer.


1 Answers

It is not such a good idea to hard-code the php path as paths might change when Travis gets update. I suggest simply calling

composer self-update
like image 92
andig Avatar answered Sep 25 '22 07:09

andig