GitXplorerGitXplorer
u

cakephp-composer

public
61 stars
12 forks
3 issues

Commits

List of commits on branch master.
Unverified
84e8fbcfe8a5a8af4758df982037636a332893e7

Fix executing composer with spaces in path

committed 11 years ago
Unverified
50069de6a24c05d6c39ac1a63c2ab6bb1995fdfc

Merge pull request #9 from eithe/master

uuzyn committed 12 years ago
Unverified
c8d4099096da90bd83482164cb6b1e808b571e45

Distinguish between Composer downloaded or error

eeithe committed 12 years ago
Unverified
8de902f29eaebcf867192a6ffb08bfa1a257cbb0

Plugin no longer passes plugin-only options to Composer. (Fixes #8)

uuzyn committed 12 years ago
Unverified
5760e4d3e3aa9e412216e7ccdd33ed684a17dd91

Usage instructions for --yes (#8)

uuzyn committed 12 years ago
Unverified
7e1396ca650a2f89814f73af09939a3ee3127892

Year increment

uuzyn committed 12 years ago

README

The README file for this repository.

CakePHP Composer Plugin

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.

This is a CakePHP plugin to use Composer conveniently with your CakePHP 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.

Requirements

CakePHP v2.x

How to use

  1. Download the plugin and place it at APP/Plugin/Composer.

    cd APP/Plugin
    git clone git://github.com/uzyn/cakephp-composer.git Composer
  2. Load the plugin by adding this line to the bottom of your app's Config/bootstrap.php:

    <?php
    CakePlugin::load('Composer', array('bootstrap' => true));
  3. That's all! Composer is ready for use.

    composer.json is located at APP/composer.json. It is automatically created if it is not found. Packages are installed to APP/Vendor as per CakePHP convention. Invoke Composer from command line with Console/cake composer.c.

    For example, to install opauth/opauth using Composer's require command.

    cd APP
    Console/cake composer.c require opauth/opauth:0.*

    To install packages defined at composer.json

    Console/cake composer.c install
  4. This plugin also makes use of Composer's autoloader. Start using a Composer-loaded classes right away without needing require(), include() or App::import().

    For example, to instantiate a new Opauth object, simply instantiate Opauth from anywhere in your CakePHP application:

    <?php
    $Opauth = new Opauth();

Extra Options

To run the plugin non-interactively, especially to automatically install composer.phar (see #8), you can include --yes or -y option, eg. Console/cake composer.c install -y.

Issues & questions

Looking for CakePHP solution or consultation? Drop me a mail. I do freelance consulting & development.

License

The MIT License Copyright © 2012-2013 U-Zyn Chua (http://uzyn.com)