Composer Upgrader is a sleek and powerful Composer plugin designed to simplify dependency management in PHP projects. With a single command, upgrade all your dependencies to their latest versions effortlessly. Whether you're maintaining a small library or a large application, this tool offers:
- Flexible Upgrades: Choose major, minor, or patch-level updates.
- Targeted Updates: Focus on specific packages with precision.
- Stability Control: Set your preferred stability level for peace of mind.
- Safe Previews: Test changes before applying them.
It updates your composer.json and prompts you to run composer update, keeping you in full control of your project!
- PHP:
^8.0+(Optimized for modern PHP versions) - Composer:
2.x
You can install Composer Upgrader either locally in your project or globally on your system:
Add it to your project:
composer require vildanbina/composer-upgraderInstall it globally for use across all projects:
composer global require vildanbina/composer-upgraderNote: Ensure your global Composer bin directory (e.g.,
~/.composer/vendor/binor~/.config/composer/vendor/bin) is in your PATH to runcomposer upgrade-allfrom anywhere. Check withecho $PATHand update if needed (e.g.,export PATH="$HOME/.composer/vendor/bin:$PATH").
No additional setup required—ready to use either way!
No configuration files needed! Customize your upgrade experience directly through command-line options for a lightweight, hassle-free setup.
Upgrade your project dependencies with ease. This command scans your composer.json, updates it with the latest compatible versions, and advises you to run composer update to apply the changes.
Usage:
composer upgrade-all [options]--major: Upgrade to the latest major versions (e.g.,1.0.0→2.0.0). Enabled by default.--minor: Upgrade to the latest minor versions (e.g.,1.0.0→1.1.0). Enabled by default.--patch: Upgrade to the latest patch versions (e.g.,1.0.0→1.0.1). Enabled by default.--dry-run: Preview upgrades without modifying files—ideal for testing.--stability <level>: Set minimum stability (stable,beta,alpha,dev). Defaults tostable.--only <packages>: Upgrade specific packages (e.g.,vendor/package1,vendor/package2).
-
Patch-Only Upgrade:
composer upgrade-all --patch
Output:
Fetching latest package versions... Found vendor/package: ^1.0.0 -> 1.0.1 Composer.json has been updated. Please run "composer update" to apply changes. -
Preview Major Upgrades:
composer upgrade-all --major --dry-run
Output:
Fetching latest package versions... Found vendor/package: ^1.0.0 -> 2.0.0 Dry run complete. No changes applied. -
Specific Packages:
composer upgrade-all --only vendor/package1 --patch
Output:
Fetching latest package versions... Found vendor/package1: ^1.0.0 -> 1.0.1 Composer.json has been updated. Please run "composer update" to apply changes.
After running, finalize the updates with:
composer update- Precision Upgrades: Tailor updates to major, minor, or patch levels with ease.
- Selective Targeting: Use
--onlyto upgrade just the packages you need. - Stability Flexibility: Match your project’s stability needs (
stable,beta, etc.). - Safe Previews: Test changes with
--dry-runbefore committing. - Verbose Logs: Add
-vfor detailed insights into the upgrade process.
Want to make this tool even better? Contributions are welcome! Check out our CONTRIBUTING guide for details on submitting bug fixes, features, or documentation improvements.
Spot a security issue? Please email [email protected] directly instead of using the issue tracker. We’ll address it swiftly!
- Vildan Bina – Creator & Lead Developer
- All Contributors – A huge thanks for your support! (See contributors)
Licensed under the MIT License (MIT). See the License File for more information.
Upgrade smarter, not harder, with Composer Upgrader! 🎉