Maxime Fabre Maxime Fabre - 1 year ago 112
PHP Question

Repository deployment and Composer : what workflow?

As a PHP developer I find myself working with Composer a lot. In the past it was on personal projects and such so I didn't have much problems with it, but now with Laravel 4 it's on project that require deploying and I'm in kind of a struggle to adapt my workflow.

All my projects are git repositories, thus per convention and because it's still quite buggy, like most developers I put the

directory in my
Now the problem is : I also use Git to deploy to the server, and by all logic the vendor directory is not uploaded as it's not tracked by the repository.

So my question is towards people that have worked with Composer and Git for longer than me : what is the best workflow to keep the server in sync ? How to track the vendor folder without really tracking it ?
I tried uploading it every time I update with Composer but some of my vendor folders are quite big and I can't manually upload 30Mb of files every time something updates.

I don't really know, how do you guys work it out ? I tried not ignoring the
folder but Git just messes it up, half are recognized as cloned repos and are just ignored anyway, etc.

UPDATE : Note that I'm on a shared host so I don't have access to the server's terminal.

Answer Source

The best way is to run composer install on the server after updating to the latest code. You should also make sure you commit your composer.lock file, which the server will then use to install (you should not run composer update on the server).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download