Test a Composer package from a local version / copy

Problem: I need to test a small change to a Composer package that’s on GitHub / Packagist, but I don’t want (yet) to request the change from the maintainer or fork my own version on Packagist or whatever… I literally just want to change one digit in a version number requirement.

Not that it’s particularly relevant, but the Package in question is a Volume storage driver for Craft CMS that makes use of Fortrabbit’s Object Storage.

Solution: Composer has a repositories feature which allows us to add Repositories other than the default Packagist.org one by adding a new block to the project’s composer.json. There are quite a lot of different sorts of repositories that can be setup, but I’m interested in the path one. This option will allow me to stick a package’s contents almost anywhere on my local machine, and path to it. Example: Continue reading “Test a Composer package from a local version / copy”