twc / gitversion-bundle
提取最后的git标签以管理应用程序版本
v1.0.4
2022-07-26 11:21 UTC
Requires
- php: >=7.2.5
- symfony/console: ^5.4|^6.0
- symfony/process: ^5.4|^6.0
Requires (Dev)
- phpunit/phpunit: ^8.5
README
提取最后的git标签以管理应用程序版本。
安装
composer require twc/gitversion-bundle
基本用法
配置
#If you want to change default value create config/packages/twc_gitversion.yaml twc_gitversion: default_version: 'v0.0.0'
生成版本
bin/console twc:generate:version
获取最后版本
使用twig
{{ twc_version }}
使用php
use Twc\GitversionBundle\Provider\GitVersionProvider; public function home(GitVersionProvider $gitVersionProvider) { $version = $gitVersionProvider->get(); dump($version->toString()); }