asgoodasnu/version-bundle

Bundle to provide a version controller

This package's canonical repository appears to be gone and the package has been frozen as a result.

Installs: 1 049

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 25

Forks: 0

Open Issues: 0

Type:symfony-bundle

v0.1.3 2016-01-08 11:25 UTC

This package is not auto-updated.

Last update: 2019-12-09 03:35:21 UTC


README

Build Status Total Downloads Latest Stable Version SensioLabsInsight

Installation

Install via composer:

composer.phar require asgoodasnu/version-bundle

Register your bundle in the AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Wk\VersionBundle\WkVersionBundle(),
        // ...
    );

    return $bundles;
}

If you want the REST API then add the following to app/config/routing.yml

_version:
    resource: "@WkVersionBundle/Resources/config/routing.yml"

Configuration

Put the following parameter into you app/config/parameters.yml

version: 1.0.0

Update this value if a new version has been deployed

Usage

Now you can retrieve the version number of your application via REST API

curl http://your-project.org/version.json

To make this version accessible for twig templates put it into app/config/config.yml

twig:
    # ...
    globals:
        version: "%version%" 

Then you can use it like that

<p>The version number is: {{ version }}</p>