PHPackages                             innovatiklabs/versioning-bundle - 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. [CLI &amp; Console](/categories/cli)
4. /
5. innovatiklabs/versioning-bundle

ActiveSymfony-bundle[CLI &amp; Console](/categories/cli)

innovatiklabs/versioning-bundle
===============================

Symfony3|4|5 application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

3.2.4(5y ago)012MITPHPPHP &gt;=7.2.5

Since Jul 23Pushed 5y agoCompare

[ Source](https://github.com/innovatiklabs/versioning-bundle)[ Packagist](https://packagist.org/packages/innovatiklabs/versioning-bundle)[ Docs](https://github.com/shivas/versioning-bundle)[ RSS](/packages/innovatiklabs-versioning-bundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (7)Versions (26)Used By (0)

versioning-bundle
=================

[](#versioning-bundle)

Updated for symfony 5.2.\*

[![SensioLabsInsight](https://camo.githubusercontent.com/c1d43110905c8bd59c39e4b5a2c2bc9076b5fc03a1a1fa897246f623de3cabdf/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f64366437333337362d623832362d343664302d383566352d6664396637376334356330362f6d696e692e706e67)](https://insight.sensiolabs.com/projects/d6d73376-b826-46d0-85f5-fd9f77c45c06)[![Total Downloads](https://camo.githubusercontent.com/7cd8dd59af810ef226f35f3427cf61e89d38eb4a2299f05b47699268db4c545e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7368697661732f76657273696f6e696e672d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/shivas/versioning-bundle)[![Build Status](https://camo.githubusercontent.com/a5c51259619b51926aa9fb0513d33ecd7c3c06b88bf11be7a7006b4fb4a876b2/68747470733a2f2f7472617669732d63692e6f72672f7368697661732f76657273696f6e696e672d62756e646c652e7376673f6272616e63683d322e302e302d616c706861)](https://travis-ci.org/shivas/versioning-bundle)

Simple way to version your Symfony Flex application.

What it is:
-----------

[](#what-it-is)

- Automatically keep track of your application version using Git tags or a Capistrano REVISION file
- Adds a global Twig variable for easy access
- Easy to extend with new version providers and formatters for different SCM's or needs
- Uses Semantic Versioning 2.0.0 recommendations using  library
- Support for manual version management

Purpose:
--------

[](#purpose)

To have an environment variable in your Symfony application with the current version of the application for various needs:

- Display in frontend
- Display in backend
- Anything you can come up with

Providers implemented:
----------------------

[](#providers-implemented)

- VersionProvider (read the version from a VERSION file)
- GitRepositoryProvider (git tag describe provider to automatically update the version by looking at git tags)
- RevisionProvider (read the version from a REVISION file)
- InitialVersionProvider (just returns the default initial version 0.1.0)

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

[](#installation)

Symfony Flex automates the installation process, just require the bundle in your application!

```
composer require shivas/versioning-bundle

```

The version is automatically available in your application.

```
# Twig template
{{ shivas_app_version }}

# Or get the version from the service
public function indexAction(VersionManager $manager)
{
    $version = $manager->getVersion();
}

```

Console commands
----------------

[](#console-commands)

There are three available console commands. You only need to run the app:version:bump command when manually managing your version number.

```
# Display the application version status
bin/console app:version:status

# Display all available version providers
bin/console app:version:list-providers

# Manually bump the application version
bin/console app:version:bump

```

Version providers
-----------------

[](#version-providers)

Providers are used to get a version string for your application. All versions should follow the SemVer 2.0.0 notation, with the exception that letter "v" or "V" may be prefixed, e.g. v1.0.0. The recommended version provider is the GitRepositoryProvider which only works when you have atleast one TAG in your repository. Be sure that all of your TAGS are valid version numbers.

Adding own provider
-------------------

[](#adding-own-provider)

It's easy, write a class that implements the ProviderInterface:

```
namespace App\Provider;

use Shivas\VersioningBundle\Provider\ProviderInterface;

class MyCustomProvider implements ProviderInterface
{

}
```

Add the provider to the container using your services file:

```
App\Provider\MyCustomProvider:
    tags:
        - { name: shivas_versioning.provider, alias: my_provider, priority: 0 }
```

```

```

Please take a look at the priority attribute, it should be between 0 and 99 to keep the providers in the right order.

Ensure your provider is loaded correctly and supported:

```
bin/console app:version:list-providers

Registered version providers
 ============= ========================================================= ========== ===========
  Alias         Class                                                     Priority   Supported
 ============= ========================================================= ========== ===========
  version       Shivas\VersioningBundle\Provider\VersionProvider          100        No
  my_provider   App\Provider\MyCustomProvider                             0          Yes
  git           Shivas\VersioningBundle\Provider\GitRepositoryProvider    -25        Yes
  revision      Shivas\VersioningBundle\Provider\RevisionProvider         -50        No
  init          Shivas\VersioningBundle\Provider\InitialVersionProvider   -75        Yes
 ============= ========================================================= ========== ===========

```

Version formatters
------------------

[](#version-formatters)

Version formatters are used to modify the version string to make it more readable. The default GitDescribeFormatter works in the following fashion:

- if the commit sha matches the last tag sha then the tag is converted to the version as is
- if the commit sha differs from the last tag sha then the following happens:
    - the tag is parsed as the version
    - the prerelease part is added with following data: "dev.abcdefa"
    - where the prerelease part "dev" means that the version is not tagged and is "dev" stable, and the last part is the commit sha

If you want to disable the default formatter, reconfigure the VersionManager in your configuration.

```
# app/config/services.yaml
Shivas\VersioningBundle\Service\VersionManager:
    arguments:
        $formatter: ~
```

Creating your own version formatter
-----------------------------------

[](#creating-your-own-version-formatter)

To customize the version format, write a class that implements the FormatterInterface:

```
namespace App\Formatter;

use Shivas\VersioningBundle\Formatter\FormatterInterface;

class MyCustomFormatter implements FormatterInterface
{

}
```

Then alias the FormatterInterface with your own:

```
# app/config/services.yaml
Shivas\VersioningBundle\Formatter\FormatterInterface: '@App\Formatter\MyCustomFormatter'
```

Capistrano v3 task for creating a REVISION file
-----------------------------------------------

[](#capistrano-v3-task-for-creating-a-revision-file)

Add following to your recipe

```
namespace :deploy do
    task :add_revision_file do
        on roles(:app) do
            within repo_path do
                execute(:git, :'describe', :"--tags --long",
                :"#{fetch(:branch)}", ">#{release_path}/REVISION")
            end
        end
    end
end

# We get git describe --tags just after deploy:updating
after 'deploy:updating', 'deploy:add_revision_file'
```

Good luck versioning your project.

Contributions for different SCM's and etc are welcome, just submit a pull request.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 57.4% 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 ~125 days

Recently: every ~139 days

Total

23

Last Release

1915d ago

Major Versions

1.4.2 → 2.0.02017-11-19

2.0.0 → 3.0.02018-01-25

2.0.1 → 3.1.22018-03-06

PHP version history (3 changes)1.0.0-RC1PHP &gt;=5.3.3

3.1.1PHP ^7.0

3.2.4PHP &gt;=7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c3ac55e46d61c38313e34435d531ebaebb9f59687873aaa43778cc3d5e96535?d=identicon)[fjugaldev](/maintainers/fjugaldev)

---

Top Contributors

[![shivas](https://avatars.githubusercontent.com/u/577493?v=4)](https://github.com/shivas "shivas (27 commits)")[![dontub](https://avatars.githubusercontent.com/u/5405481?v=4)](https://github.com/dontub "dontub (14 commits)")[![fjugalde](https://avatars.githubusercontent.com/u/69464238?v=4)](https://github.com/fjugalde "fjugalde (4 commits)")[![samnela](https://avatars.githubusercontent.com/u/1852108?v=4)](https://github.com/samnela "samnela (1 commits)")[![wassafr](https://avatars.githubusercontent.com/u/10235180?v=4)](https://github.com/wassafr "wassafr (1 commits)")

---

Tags

semverversioningsemanticversion

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/innovatiklabs-versioning-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/innovatiklabs-versioning-bundle/health.svg)](https://phpackages.com/packages/innovatiklabs-versioning-bundle)
```

###  Alternatives

[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[nikolaposa/version

Value Object that represents a SemVer-compliant version number.

1406.4M16](/packages/nikolaposa-version)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[z4kn4fein/php-semver

Semantic Versioning library for PHP. It implements the full semantic version 2.0.0 specification and provides ability to parse, compare, and increment semantic versions along with validation against constraints.

251.5M17](/packages/z4kn4fein-php-semver)[madewithlove/license-checker

CLI tool to verify allowed licenses for composer dependencies

54449.8k21](/packages/madewithlove-license-checker)

PHPackages © 2026

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