forelse / version-bundle
Manage your application version
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.4
- symfony/config: ^5.4
- symfony/dependency-injection: ^5.4
- symfony/http-kernel: ^5.4
Requires (Dev)
- phpunit/phpunit: ^9.5
README
This bundle allows to load the version number of the application by reading the version.yaml file in the config/packages folder
Setup
Use composer to install
composer require forelse/version-bundle
Configuration
You can customize the parameter bag key in the yaml configuration file.
version: app_version: 1.0.0.0 parameterbag_key: app.version
Usage
The version number of the application is then available in the ParameterBag
class IndexController extends AbstractController { /** * @Route("/", name="home") */ public function index(ParameterBagInterface $parameterBag): Response { $version = $parameterBag->get('app.version'); } }