Skip to content

Instantly share code, notes, and snippets.

@dariodiaz
Forked from johnpbloch/composer.json
Created August 10, 2013 18:25
Show Gist options
  • Save dariodiaz/6201558 to your computer and use it in GitHub Desktop.
Save dariodiaz/6201558 to your computer and use it in GitHub Desktop.
PHP: phpunit global installation
{
"name": "phpunit",
"description": "PHPUnit Composer Package",
"require": {
"phpunit/phpunit": "3.7.*"
},
"config": {
"bin-dir": "/usr/local/bin/"
}
}
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
mkdir -p /usr/local/lib/phpunit
mv composer.json /usr/local/lib/phpunit
cd /usr/local/lib/phpunit
if [ `which composer` ]; then
composer install
else
if [ ! -f './composer.phar' ]; then
curl -sS https://getcomposer.org/installer | php
fi
php composer.phar install
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment