Using Composer with Yii
Composer is a dependency manager for PHP that recently became quite popular. It allows you to configure all the dependencies for your project and then handles all the downloading and configuring. Since it's easy to install it's a good choice if:
You're working in a team and want new team members to configure projects in just a minute
You're distributing a product and don't want to blat it with libraries and framework
You need to control which library version requires which other library version
Composer is well documented but there are some specific things about using it with Yii. In the next example we'll configure our application to download Yii and some additional packages using Composer.
Getting ready
We need to prepare first.
Install Composer from http://getcomposer.org/download/.
Point your webserver root to an empty directory. Let's call it
webroot.
How to do it...
In order to configure the project we need only a JSON file with dependencies description. Create
webroot...