This forum post will be useful for those people who use Git as SCM for the project, If you don’t
, so there is one more reason to discover and use Git
Did you have the situation when you needed to know exactly what the version of your app is deployed into the production?
Personally, the most simple and powerful approach is using the git id and last commit time in the footer.
In Yii you can do it by installing simple component GitBuildNumberComponent
The screenshot below demonstrates what does this component:
Copy the GitBuildNumberComponent.php file to your webapp /protected/components/ folder.
After downloading and installing the component into right place you have to tell yii framework about tne new component:
- Edit your webapp
- And add the following somewhere in the components section -
'git'=>array( 'class'=>'GitBuildNumberComponent', )
- After this modification your
file may looks like this:
Using scenario example:
If you are interested in the component history and motivation you can find some information in my blog entry