We have a PHP project and this is our first product delivery. We want to add a disclaimer to all *.php files in the project. Is there any free/OS tool that we can use to avoid donkey work :( ? We have around 100 source code files.
You could write a script to do it.
It is fairly unlikely that there is a tool out there that does specifically this, seeing that is fairly trivial. (Not to say that such a tool does not exist)
A simple shell script would do, if you are using linux. You can write a small PHP command line script which will take as input a file name, open the file, and replace the first <?php with <?php /* Your disclaimer */
Then you can call this script with something like this:
find . -name '*.php' exec php yourscript.php \{\} \;
But try first on some copy, and be sure you don't introduce regressions.
In linux there are tools too, (kfilereplace for instance), but I don't trust that.
Or grep and sed, if you are the hardcore kind :)
Please don't do that. It just annoys the developer who takes over. I always do a huge regex replace to get rid of those annoying disclaimers.