PHPackages                             zenstruck/version-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zenstruck/version-bundle

AbandonedArchivedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

zenstruck/version-bundle
========================

Keep track of your Symfony2 application's version

v1.0.0(13y ago)37.6k2MITPHPPHP &gt;=5.3.0

Since Jun 29Pushed 13y ago1 watchersCompare

[ Source](https://github.com/kbond/ZenstruckVersionBundle)[ Packagist](https://packagist.org/packages/zenstruck/version-bundle)[ Docs](http://zenstruck.com/project/ZenstruckVersionBundle)[ RSS](/packages/zenstruck-version-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Introduction
============

[](#introduction)

Keep track of your Symfony2 application's version. Knowing what build/version number an application in staging/production is important.

Many projects have a VERSION or BUILD file created by the developer or CI server. This bundle provides a block, twig function, and web debug toolbar panel to output both the application's and Symfony's version. The version is available throughout your project as a service. You can inject the current version in perhaps a `meta`tag for your production environment.

Installation
============

[](#installation)

1. Install the bundle through composer :

```
{
    "require": {
        // ...
        "zenstruck/version-bundle": "dev-master"
    }
}
```

2. Create a `VERSION` file in your project's root directory
3. Configure the bundle:

    ```
     # Example
     # app/config_dev.yml
     zenstruck_version:
         enabled: true
         toolbar: true

     #app/config_staging.yml
     zenstruck_version:
         enabled: true
         toolbar: false
         block:
             enabled: true

    ```

Usage
=====

[](#usage)

When enabled, this plugin defines two twig functions:

- `version()`: outputs the current application version (as defined in your `VERSION` file)
- `symfony()`: outputs the current Symfony version (as defined in `Symfony\Component\HttpKernel\Kernel::VERSION`)

And adds a service to Symfony's service container:

- `zenstruck.version.data_collector`

Examples
========

[](#examples)

Access service in a controller:

```
...
public function indexAction()
{
    $versionDC = $this->get('zenstruck.version.data_collector');

    $appVersion = $versionDC->getVersion();
    $symfonyVersion = $versionDC->getSymfony();
    ...
}
...

```

Render in template:

```
{# twig template #}
{{ version() }}
{{ symfony() }}

```

Render a `meta` tag with application version and Symfony version:

```
...

...

```

Extend
======

[](#extend)

Use your own Version DataCollector
----------------------------------

[](#use-your-own-version-datacollector)

1. Overrride the default `VersionDataCollector` class:

    ```
     // MyVersion.php
     use Zenstruck\Bundle\VersionBundle\DataCollector\VersionDataCollector;

     class MyVersion extends VersionDataCollector
     {
         public function getVersion()
         {
             return $myversion;
         }
     }

    ```
2. Set you `VersionDataCollector` class in `app/config.yml`:

    ```
     // app/config.yml
     parameters:
         zenstruck.version.data_collector.class: \MyVersion

    ```

Full Default Configuration
==========================

[](#full-default-configuration)

```
# config.yml
zenstruck_version:
    enabled: false                      # enable/disable service
    toolbar: false                      # show in web debug toolbar
    file: %kernel.root_dir%/../VERSION  # the file containing version info
    suffix: ~                           # suffix text (ie "-dev")
    version: ~                          # overrides file/text with custom version
    block:
      enabled: false                    # enable/disable block
      position: vb-bottom-right         # other values: vb-bottom-left, vb-top-right, vb-top-left
      prefix: "Version: "               # text added to beginning of block

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

5068d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/707369cc916e0ea1aacbf077dcba464f611cef879f024d8944311a54a15224b3?d=identicon)[kbond](/maintainers/kbond)

---

Top Contributors

[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (29 commits)")[![maxailloud](https://avatars.githubusercontent.com/u/792787?v=4)](https://github.com/maxailloud "maxailloud (6 commits)")

---

Tags

version

### Embed Badge

![Health badge](/badges/zenstruck-version-bundle/health.svg)

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

###  Alternatives

[pragmarx/version

Take control over your Laravel app version

5921.2M2](/packages/pragmarx-version)[nikolaposa/version

Value Object that represents a SemVer-compliant version number.

1406.4M16](/packages/nikolaposa-version)[liip/rmt

Release Management Tool: a handy tool to help releasing new version of your software

457448.7k74](/packages/liip-rmt)[wolfcast/browser-detection

The Wolfcast BrowserDetection PHP class facilitates the identification of the user's environment such as Web browser, version, platform family, platform version or if it's a mobile device or not.

1391.0M7](/packages/wolfcast-browser-detection)[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)[bartlett/php-compatinfo

Find out the minimum version and the extensions required for a piece of code to run

38298.7k7](/packages/bartlett-php-compatinfo)

PHPackages © 2026

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