The component for Yii framework to retrieve the build information (last commit id and commit time).
This is a very simple component that uses internally the git cmd functions.
The idea of writing this component comes from my Java experience with very popular plugin maven-build-number.
So after making some improvements for existing maven plugin I decided to make something similar for the PHP/Yii world. I think that the little usefull and effortless tricks like this one, can make you application more proffessional.
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/protected/config/main.php file
- And add the following somewhere in the components section -
'git'=>array( 'class'=>'GitBuildNumberComponent', )
- After this modification your
protected/config/main.phpfile may looks like this:
The component has been tested on Yii 1.1.12 and PHP 5.4.