Custom Composer Packages and Install Paths

Ever wanted to require a Git package via Composer that's hosted on git, this is how you can achieve this!
Also, discovered a very handy Composer plugin that lets you specify custom install paths for packages!

{
	...
	"repositories": [
		{
			"type": "package",
			"package": {
				"name": "lx-berlin/silverstripe-flexslider",
				"version": "master",
				"source": {
					"type": "git",
					"url": "https://github.com/lx-berlin/silverstripe-flexslider.git",
					"reference": "origin/master"
				}
			}
		}
	],	
	"require": {
		...
		"lx-berlin/silverstripe-flexslider": "dev-master",
		"mnsami/composer-custom-directory-installer": "^1.0"
	},
	...
	"extra":{
		"installer-paths":{
			"./flexslider/": ["lx-berlin/silverstripe-flexslider"]
		}
	}
}

 

References
https://packagist.org/packages/mnsami/composer-custom-directory-installer