vildanbina / composer-upgrader
Effortlessly upgrade all Composer dependencies to their latest versions with a single command.
Fund package maintenance!
vildanbina
Buy Me A Coffee
Installs: 89
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: ^8.0
- composer-plugin-api: ^2.0
Requires (Dev)
- composer/composer: ^2.0
- phpunit/phpunit: ^9.5
README
Introduction
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!
Requirements
- PHP:
^8.0+
(Optimized for modern PHP versions) - Composer:
2.x
Installation
You can install Composer Upgrader either locally in your project or globally on your system:
Local Installation
Add it to your project:
composer require vildanbina/composer-upgrader
Global Installation
Install it globally for use across all projects:
composer global require vildanbina/composer-upgrader
Note: Ensure your global Composer bin directory (e.g.,
~/.composer/vendor/bin
or~/.config/composer/vendor/bin
) is in your PATH to runcomposer upgrade-all
from anywhere. Check withecho $PATH
and update if needed (e.g.,export PATH="$HOME/.composer/vendor/bin:$PATH"
).
No additional setup required—ready to use either way!
Configuration
No configuration files needed! Customize your upgrade experience directly through command-line options for a lightweight, hassle-free setup.
Commands
upgrade-all
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]
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
).
Examples:
-
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
Features
- Precision Upgrades: Tailor updates to major, minor, or patch levels with ease.
- Selective Targeting: Use
--only
to upgrade just the packages you need. - Stability Flexibility: Match your project’s stability needs (
stable
,beta
, etc.). - Safe Previews: Test changes with
--dry-run
before committing. - Verbose Logs: Add
-v
for detailed insights into the upgrade process.
Contributing
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.
Security Vulnerabilities
Spot a security issue? Please email vildanbina@gmail.com directly instead of using the issue tracker. We’ll address it swiftly!
Credits
- Vildan Bina – Creator & Lead Developer
- All Contributors – A huge thanks for your support! (See contributors)
License
Licensed under the MIT License (MIT). See the License File for more information.
Upgrade smarter, not harder, with Composer Upgrader! 🎉