在php源文件中添加全局修订号

I want to replace a global revision no (head) in my PHP source files whenever I make a checkin (or update)

for example I have below code

<?php 

print 'Rv no : $glbRevisionNumber$';

?>

in all the php files that have under one folder eg. myapp/* the $glbRevisionNumber$ should get replaced with the current head revision number.

How can I achieve this ?

Create a pre-commit hook in your version control system that does a replace of $glbRevisionNumber$ in every committed file.