ollieread / composer-local-repositories
Composer plugin that automatically loads local package repositories
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 2
Forks: 2
Open Issues: 0
Type:composer-plugin
pkg:composer/ollieread/composer-local-repositories
Requires
- php: ^8.1
- composer-plugin-api: ^2.6
Requires (Dev)
- composer/composer: ^2.7
- phpstan/phpstan: ^1.11
README
The composer plugin to quickly add local repositories for development purposes, without the need to update
your composer.json file.
How to install
composer global require ollieread/composer-local-repositories
How to use
Add a repositories.json file to any project that you want to add a custom repository to. The file needs to contain a
valid composer repositories key. For example:
repositories.json
{
"repositories": [
{
"type": "path",
"url": "../local-folder"
}
]
}
During a composer install or composer update, the plugin will locate the repositories.json file; and prepend all
the configured repositories. If composer finds any of the require packages inside these repositories, it will install
the package from that repository instead.
Configuration
To configure the plugin, you can provide extra configuration keys under a local-repositories key in the extra
section.
trigger-commandsAn array of composer commands that loads the localrepositories.jsonfile (default:installandupdate)ignore-flagsAn array of flags on which to ignore the localrepositories.jsonfile (default:--no-devand--prefer-source)force-devWhether to update the constraint of any found packages from local repositories with@dev( default:true)
Full configuration example with default values:
global composer.json
{
"extra": {
"local-repositories": {
"trigger-commands": [
"install",
"update"
],
"ignore-flags": [
"no-dev",
"prefer-source"
],
"force-dev": true
}
}
}