Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.
With Packagist, you get access to a vast library of reusable PHP components that will help a lot in your development work.
This is a CakePHP plugin to use Composer conveniently with your CakePHP 2.x project.
There is no need to pre-install Composer.
This plugin will automatically download the latest version if Composer is not installed at your system.
Packages downloaded via this Composer plugin will be installed at
as per CakePHP convention.
Download the plugin and place it at
Or via Git:
cd APP/Plugin git clone git://github.com/uzyn/cakephp-composer.git Composer
Load the plugin by adding this line to the bottom of your app's
<?php CakePlugin::load('Composer', array('bootstrap' => true));
That's all! Composer is ready for use.
composer.jsonis located at
APP/composer.json. It is automatically created if it is not found.
Packages are installed to
APP/Vendoras per CakePHP convention.
Invoke Composer from command line with
For example, to install opauth/opauth using Composer's
cd APP Console/cake composer.c require opauth/opauth:0.*
To install packages defined at
Console/cake composer.c install
This plugin also makes use of Composer's autoloader.
Start using a Composer-loaded classes right away without needing
For example, to instantiate a new Opauth object, simply instantiate Opauth from anywhere (model, controller, view, literally anywhere) in your CakePHP application:
<?php $Opauth = new Opauth();