This document describes how to use Composer for PHP on Engine Yard Cloud.
Composer is a dependency manager for PHP (similar to Bundler for Ruby apps). Composer allows developers to specify project dependencies in a composer.json file and then Composer automatically handles the rest.
Composer makes it easier to keep vendor libraries out of your repo, meaning that only application code goes in the git repository. It also makes maintaining the latest versions of all required libraries easier because you can simply run composer update to get the latest compatible packages.
If you don't already have Composer installed on your local machine, you can get it on the Composer download site.
When you deploy your PHP app, Engine Yard Cloud detects if you have a composer.lock file in your repo. If you do, then it runs composer install which takes the contents of your composer.lock file and downloads the required packages. Once Composer successfully installs all the packages and creates the autoload script for your application, Engine Yard Cloud removes the symlink to your previous deploy and replaces it with a link to the current deploy.
Engine Yard Cloud also ensures that you are always using the latest version of Composer by running composer self-update with each app deploy.
Important: We recommend testing in a staging environment before applying changes in a production environment.