4

How should I be keeping track of a php script's versions/changes when it pertains to a single script in one file?

Should I have a separate changelog, and if so (1) what should it be named, (2) how should the contents of the log be formatted, and (3) how should the log be associated with the php script/file?

Or, should I include the changes in a comment at the top of the php file? Currently, I have the following comments at the top of the file:

/**
 * @author    John Doe <contact@John Doe.com>
 * @version   1.0
 * @copyright Copyright (c) 2010, John Doe
 */

Thanks in advance for your response!

Wilkons2
  • 111
  • 4

2 Answers2

9

Aren't you using a VCS such as SVN, Git or Mercurial? There's no better way to keep track of the changes than being able to see the difference of the file. Of course, you would want to include the changelog on both: the main comment block and the last commit you do.

Cristian
  • 1,403
  • 12
  • 16
  • Consider me a php noob. I am not using any of those tools you mentioned. Perhaps you could dumb down your answer a little more for me? Thanks again for your help! – Wilkons2 Sep 24 '10 at 14:46
  • 2
    @Wilkons2: look at http://www.ericsink.com/scm/source_control.html and/or http://hginit.com/ for some information on source control. I'll second Cristian's recommendation to use some sort of system. For the time being I've switched to Mercurial and love it. Search around here and StackOverflow.com and you'll see a number of suggestions and commentary related to the various options that are available. – AnonJr Sep 24 '10 at 15:11
1

Bro, use a versioning control system, svn, git, mercurial, even old CVS is better than nothing. And these are independent of whether you are using PHP or some other programming/scripting languages(s).

luis.espinal
  • 2,560
  • 1
  • 20
  • 17
  • Theres no need for this duplicate answer, please delete. – alternative Oct 16 '10 at 23:53
  • 2
    It isn't a duplicate since mine 1) mentions CVS; 2) estates that even an old system like CVS is better than what you are/were describing; and states that version control has nothing to do with someone being new to PHP (or any programming language for that matter.) Let other readers decide if this is being redundant. Thanks – luis.espinal Oct 18 '10 at 02:55
  • Bro, +1 for the intro – Joan-Diego Rodriguez Apr 15 '15 at 07:30