"Talk is cheap. Show me the code."
-- Linus Torvalds
Run at the command line
$ curl -sS https://getcomposer.org/installer | php
Make a composer.json file
{
"require": {
"php": ">=5.3.2",
"composer/composer": "1.0.*@dev",
"composer/satis": "1.0.*@dev"
}
}
$ php composer.phar install -o
Make a satis.json file
{
"name": "WebLaCarte Package Server",
"homepage": "http://packages.weblacarte.com/",
"repositories": [
{
"type": "git",
"url": "git@github.com:philsown/Example-Required-Package.git"
}
],
"require-all": true
}
$ vendor/bin/satis build satis.json public
$ git clone git@github.com:philsown/Example-Package.git Example-Package
Modify composer.json
"repositories": [
{
"type": "composer",
"url": "http://packages.weblacarte.com/"
}
]
Still in composer.json
"require": {
"philsown/Example-Required-Package": "dev-master"
}
... Again!
$ php composer.phar install -o
Back in satis.json, add the "archive" section
"archive": {
"directory": "dist",
"format": "tar",
"prefix-url": "http://packages.weblacarte.com"
}
... Again!
$ vendor/bin/satis build satis.json public
Make an .htpasswd File
$ htpasswd -c .htpasswd composer
Make an .htaccess file
AuthType Basic
AuthName "Package Server"
AuthUserFile /path/to/.htpasswd
Require valid-user
Back in your project...
This time, prefer-dist
$ php composer.phar install -o --prefer-dist