Install Zend Framework 2 and Doctrine 2 using Composer

Since the installation instructions aren’t overly clear (I don’t find) for how to install more than one package to a project, you need a composer.json that looks akin to the following:

{
        "require": {
                "doctrine/orm": "*",
                "zendframework/zendframework": "2.0.*"
        }
}

What caught me out is that all the packages you want need to be in the require object, and that unlike say Puppet you can’t have multiple require blocks as it will just use the last one declared (since they have the same name)

Therefore to install from scratch, you need something similar to the following series of commands:

curl -s getcomposer.org/installer | php -d detect_unicode=Off
vim composer.json
php composer.phar install

If you put those packages in composer.json then running Composer’s install command will attempt to retrieve those packages from Packagist

 

1 comment