PHPackages                             shalvah/upgrader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. shalvah/upgrader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shalvah/upgrader
================

Create automatic upgrades for your package.

0.6.0(2y ago)1512.9M↓19.6%[1 issues](https://github.com/shalvah/upgrader/issues)5MITPHPPHP &gt;=8.0

Since Jul 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/shalvah/upgrader)[ Packagist](https://packagist.org/packages/shalvah/upgrader)[ Docs](http://github.com/shalvah/upgrader)[ Patreon](https://patreon.com/shalvah)[ RSS](/packages/shalvah-upgrader/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (6)Versions (14)Used By (5)

Upgrader
========

[](#upgrader)

[![Latest Stable Version](https://camo.githubusercontent.com/3fb9321f0f556905116bfb564c91116da976d3a3b95b5c88a4dcf09d20250e92/68747470733a2f2f706f7365722e707567782e6f72672f7368616c7661682f75706772616465722f762f737461626c65)](https://packagist.org/packages/shalvah/upgrader) [![Total Downloads](https://camo.githubusercontent.com/c1d715518b2f0fc940969141c2f934bb37b4fa4bde542fdc026e003c340fa0b4/68747470733a2f2f706f7365722e707567782e6f72672f7368616c7661682f75706772616465722f646f776e6c6f616473)](https://packagist.org/packages/shalvah/upgrader)

Releasing a new version of your PHP library with changes to the config file? Use this tool to offer an automated upgrade process to your users. Used for implementing automated upgrades in [Scribe](https://scribe.knuckles.wtf/laravel/migrating-v4) — just run `php artisan scribe:upgrade`.

Give `Upgrader` a sample of your new config file, and the path to the user's old config file, and it'll figure out what's been added or removed in the new version. You can also tell it to move/rename certain fields or ignore others.

```
// Create a CLI `upgrade` command, where you call Upgrader

// Relative path to the config file in the user's project
$userOldConfigFile = 'config/my_library.php';
// Absolute path to a sample of the new config in your project
$sampleNewConfigFile = __DIR__ . '/../../config/my_library.php';

$upgrader = Upgrader::ofConfigFile($userOldConfigFile, $sampleNewConfigFile)
  ->move('path', 'static.path')
  ->dontTouch('ip_addresses');

   // If this is a dry run, print the expected changes
   if ($this->option('dry-run')) {
     $changes = $upgrader->dryRun();
     if (empty($changes)) {
       $this->info("No changes needed! Looks like you're all set.");
       return;
     }

     $this->info('The following changes will be made to your config file:');

     foreach ($changes as $change) {
       $this->info($change["description"]);
     }

     return;
}

// Otherwise, run the upgrade 🚀
$upgrader->upgrade();
```

Upgrader:

- Comes with "dry run" functionality, so you can review expected changes.
- Will back up the user's old config file to `{$file}.bak` so you can revert if you need to.
- Supports keys as dot notation

Upgrader is still early days (0.x), with more robust features and docs planned. Read how I built it [here](https://blog.shalvah.me/posts/implementing-programmatic-file-transformations-in-php).

Installation
------------

[](#installation)

PHP 8+ is required.

```
composer require shalvah/upgrader
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity53

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~78 days

Recently: every ~132 days

Total

13

Last Release

865d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.4

0.3.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef367e338eb001771b4d439508b7a355d62dc2712ff94017393913e853816abb?d=identicon)[shalvah](/maintainers/shalvah)

---

Top Contributors

[![shalvah](https://avatars.githubusercontent.com/u/14361073?v=4)](https://github.com/shalvah "shalvah (41 commits)")[![negoziator](https://avatars.githubusercontent.com/u/2228675?v=4)](https://github.com/negoziator "negoziator (1 commits)")

---

Tags

upgrade

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/shalvah-upgrader/health.svg)

```
[![Health](https://phpackages.com/badges/shalvah-upgrader/health.svg)](https://phpackages.com/packages/shalvah-upgrader)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[laravel/surveyor

Static analysis tool for Laravel applications.

86121.4k13](/packages/laravel-surveyor)[zidbih/laravel-deadlock

Make temporary Laravel workarounds expire and fail CI when ignored.

985.4k](/packages/zidbih-laravel-deadlock)[v.chetkov/php-clean-architecture

PHP Clean Architecture

14661.1k](/packages/vchetkov-php-clean-architecture)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
