Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to require a Gist using Composer
add_gist_repository(){
composer config repositories.$1 '{"type":"package","package": {"name": "'$1'","version": "master","source": {"url": "https://gist.github.com/'$1'.git","type": "git","reference":"master"},"autoload": {"classmap": ["."]}}}'
}
require_gist(){
add_gist_repository $1
composer require $1:dev-master
}
require_dev_gist(){
add_gist_repository $1
composer require-dev $1:dev-master
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment