Adding Copyright Headers to Files

For the past month or so, I’ve been doing some consulting with IntraHealth. We’re about to release a sizable webapp under the GPLv3 and one of the tasks is adding the proper headers to the files. Oh, of note, the Free Software Foundation has entered the age of the web. Instead of telling you to “write to the FSF at…”, if you need a copy of the full license, you are told to visit Anyway, there seems to be a real lack of tools to help with this. Sure, there is this ruby script from Xavier Hanin, a one off and, finally, this Perl script. None of these supports PHP. So I grabbed the Perl script, made a couple of changes to add support for the GPLv3 and PHP. Here it is. The tool could really use a lot of improvement. More file types, more licenses, better detection, etc. But, for now, it’ll do.

2 thoughts on “Adding Copyright Headers to Files”

  1. Re: I did something similar

    If you’re distributing the code and you want other people to contribute to a shared repository, then you really need to have the copyright header at the top of every file. See, for example, the kernel source code.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.