Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ollieread-ltd/composer-local-repositories
Composer plugin to add support for local repositories.json files
https://github.com/ollieread-ltd/composer-local-repositories
composer composer-plugin local-development php php-package-development
Last synced: about 2 months ago
JSON representation
Composer plugin to add support for local repositories.json files
- Host: GitHub
- URL: https://github.com/ollieread-ltd/composer-local-repositories
- Owner: ollieread-ltd
- Created: 2024-06-19T20:47:27.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-04T20:48:58.000Z (4 months ago)
- Last Synced: 2024-10-31T06:51:35.035Z (about 2 months ago)
- Topics: composer, composer-plugin, local-development, php, php-package-development
- Language: PHP
- Homepage:
- Size: 16.6 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Composer Local Repositories
The composer plugin to quickly add local repositories for development purposes, without the need to update
your `composer.json` file.## How to install
```bash
composer require global 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`**
```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-commands` An array of composer commands that loads the local `repositories.json` file (default: `install`
and `update`)
- `ignore-flags` An array of flags on which to ignore the local `repositories.json` file (default: `--no-dev`
and `--prefer-source`)
- `force-dev` Whether to update the constraint of any found packages from local repositories with `@dev` (
default: `true`)Full configuration example with default values:
**global `composer.json`**
```json
{
"extra": {
"local-repositories": {
"trigger-commands": [
"install",
"update"
],
"ignore-flags": [
"no-dev",
"prefer-source"
],
"force-dev": true
}
}
}
```