Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice to display the version of a Symfony application to the user?

We built a web application build on top of the Symfony2 framework.

Now we need to display the current version of our software in the front end for the user to see. The version number is currently a tag in the git repository.

Now what is considered best practice to achieve this? The Composer documentation discourages the use of the version field used in the composer.json

Symfony itself seems to set the version string in the app/bootstrap.php.cache file: const VERSION ='2.7.6';

Is there any best practice regarding this issue? Is there a way to directly access the git tag name? Or should I go with the constant or composer.json way?

like image 410
mpbzh Avatar asked Jan 26 '16 13:01

mpbzh


1 Answers

You could try versioning-bundle. From their doc:

  • Adds additional parameter to your parameters.yml file and keeps it inline with your current application version.
  • Basic Version handlers implemented for manual and git tag versioning
like image 120
Ilya Yarkovets Avatar answered Nov 10 '22 01:11

Ilya Yarkovets