A Composer plugin for linking local packages during development, similar to npm link.
- No project files - All link information is stored in the global Composer directory
- Simple workflow - Register once, link anywhere
- Clean development - No modifications to your composer.json
- Automatic backups - Original packages are preserved and can be restored
- Composer 2.0+
- PHP 8.2+
- Filesystem that supports symbolic links
composer global require takeshiyu/composer-linkerFirst, register your local package globally:
# In your package directory
composer link
# Or specify a path
composer link /path/to/your/packageThis makes the package available for linking in any project.
In your project directory, link to a registered package:
composer link vendor/packageThis creates a symbolic link in your vendor directory pointing to the local package source.
Show all packages linked in your current project:
composer linkedShow all globally registered packages:
composer linked --globalShow all projects and their linked packages:
composer linked --allRestore a package to the installed version:
composer unlink vendor/packageThis plugin:
- Stores all link information in a central links.json file in ~/.composer/links/
- Uses symbolic links to connect your project to local packages
- Preserves your composer.json file (no modifications needed)
- Works at the filesystem level, similar to npm link
- Never creates any files in your project directory
- No files in your project directory that could be committed to version control
- Consistent workflow across projects
- Easy to switch between development and production versions
- Works with Composer's autoloading system
Composer Linker package is open-sourced software licensed under the MIT license