Composer

From Freephile Wiki
Revision as of 18:33, 30 March 2015 by Freephile (talk | contribs) (Created page with "Composer is a dependency manager that makes it easier to distribute PHP code that relies on other code. Installing it on your own host would look something like this <so...")

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Composer is a dependency manager that makes it easier to distribute PHP code that relies on other code.

Installing it on your own host would look something like this

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# now you can use it to do things like install the latest version of Drush
composer global require drush/drush:dev-master

while installing it on a shared host like WebFaction would be slightly modified

ln -s `which php54` ~/bin/php
curl -sS https://getcomposer.org/installer | php54
mv composer.phar ~/bin/composer
echo -e '\n# Composer\nalias composer="php54 $HOME/composer.phar"' >> ~/.bash_profile
source ~/.bash_profile
which composer
# now you can use it to do things like install the latest version of Drush
composer global require drush/drush:dev-master
drush --version