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
Requires
- php: >=5.3.3
- friendsofsymfony/rest-bundle: ~1.5
- sensio/framework-extra-bundle: ~3.0
- symfony/framework-bundle: ~2.6
Requires (Dev)
- jms/serializer-bundle: ~0.13
- phpunit/phpunit: ~4.6
- symfony/browser-kit: ~2.6
This package is not auto-updated.
Last update: 2019-12-09 03:35:21 UTC
README
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>