Download the PHP package folivoro/branch without Composer
On this page you can find all versions of the php package folivoro/branch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download folivoro/branch
More information about folivoro/branch
Files in folivoro/branch
Package branch
Short Description Local package development for Composer without modifying composer.json
License MIT
Informations about the package branch
Branch
Local package development for Composer without touching composer.json
The Problem
When developing packages locally, you typically need to either:
- Modify
composer.json- Add path repositories, remember to remove them before committing - Use
composer link- Extra setup, can get confused with global installs
Both approaches are error-prone and easy to forget.
The Solution
Drop a branch-local.json next to your composer.json and you're done. No modifications needed.
Create branch-local.json:
Run composer install or composer update. That's it.
How It Works
The plugin reads branch-local.json at pre-install and pre-update time and registers each path as a Composer PathRepository. It automatically extracts the version constraint from your composer.json's require block and uses the lower bound, so your local branches can be named anything.
Version Resolution
| Consumer require | Local version used |
|---|---|
^1.0.0 |
1.0.0 |
~2.1.0 |
2.1.0 |
>=3.0.0 |
3.0.0 |
dev-main |
dev-main |
Path Formats
- Relative:
../my-package(relative to working directory) - Absolute:
/Users/dev/packages/my-package
Installation
Global (Recommended)
Allow the plugin:
Per-project
Configuration
The plugin reads branch-local.json from the project root as a flat key-value map:
Global vs Per-project
| Mode | branch-local.json location | Use case |
|---|---|---|
| Global | Project root | Works across all projects |
| Per-project | Inside a project | Project-specific overrides |
Requirements
- PHP 8.1+
- Composer 2.0+
License
MIT
All versions of branch with dependencies
composer-plugin-api Version ^2.0