PHPackages                             andreypostal/php-stuff-versioned - 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. andreypostal/php-stuff-versioned

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

andreypostal/php-stuff-versioned
================================

v0.0.1(1y ago)751MITPHPCI passing

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/andreypostal/php-stuff-versioned)[ Packagist](https://packagist.org/packages/andreypostal/php-stuff-versioned)[ RSS](/packages/andreypostal-php-stuff-versioned/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (1)

Stuff Versioned
===============

[](#stuff-versioned)

[![Coverage Status](https://camo.githubusercontent.com/c8990f5cb7db5da527dc84c7c17a6d7cfd7919a98c03bf20c123170981e8f32e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616e64726579706f7374616c2f7068702d73747566662d76657273696f6e65642f62616467652e7376673f6272616e63683d6d61696e26743d31)](https://coveralls.io/github/andreypostal/php-stuff-versioned?branch=main&t=1)

This is a light library with zero dependency that provides a version manager and interfaces for version control anything and with any desired backend (like file, mysql, mongodb, postgresql...)

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

[](#installation)

```
composer require andreypostal/php-stuff-versioned

```

Available backends
------------------

[](#available-backends)

- [MongoDB](https://github.com/andreypostal/php-stuff-versioned-mongo)

Usage
-----

[](#usage)

Create your versions implementing the [VersionInterface](./src/VersionInterface.php). This can be used to version stuff like data seed, data migrations, system updates....

The versioning process is controlled by the ID and can be used dynamically, like to perform versioning based on users or organization.

[BackendInterface](./src/BackendInterface.php) defines the structure needed to persist the versioning progress/history and will be used as checkpoints in the versioning process, ensuring we don't re-execute previous successful versions.

The only actual code shipped by this library is the [VersionManager](./src/VersionManager.php)which only control the version list and the execution (run process) ensuring that we do not execute the same version id twice.

The order of version inclusion in the VersionManager maters and old versions should never change position or be removed. If some old version should not be executed on new environments, you should just skip if by returning 'false' in the check process.

Some simple library usage may look like:

```
$manager = new \Andrey\StuffVersioned\VersionManager(
    new MongoBackend(), // the chosen backend
    $logger, // this is optional
);
$manager->addVersion(new MyVersion_2025_03_01());
$manager->addVersion(new MyVersion_2025_03_02());
// or
$manager = $manager
    ->withVersion(new MyVersion_2025_03_03())
    ->withVersion(new MyVersion_2025_03_04());

// New versions should be added here at the end

$manager->run();
```

And your version implementation may look like:

```
class MyVersion_2025_03_01 implements \Andrey\StuffVersioned\VersionInterface
{
    public function check(): bool
    {
        return true;
    }

    public function run(): void
    {
        // Create some data
    }

    public function rollback(): void
    {
        // Delete partially created data
    }

    public function getId(): string
    {
        return 'MyVersion_2025_03_01';
    }
}
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance44

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

446d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15055086?v=4)[Andrey Postal](/maintainers/andreypostal)[@andreypostal](https://github.com/andreypostal)

---

Top Contributors

[![andreypostal](https://avatars.githubusercontent.com/u/15055086?v=4)](https://github.com/andreypostal "andreypostal (8 commits)")

---

Tags

phpphp-libraryversionversion-controlversion-managerversioning

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/andreypostal-php-stuff-versioned/health.svg)

```
[![Health](https://phpackages.com/badges/andreypostal-php-stuff-versioned/health.svg)](https://phpackages.com/packages/andreypostal-php-stuff-versioned)
```

###  Alternatives

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514139.2M692](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

368116.8k12](/packages/logiscape-mcp-sdk-php)

PHPackages © 2026

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