Forum Moderators: coopster

Message Too Old, No Replies

Generate PHP documentation

Comment headers at the beginning of each file

         

andrewheiss

3:58 am on Jun 30, 2008 (gmt 0)

10+ Year Member



I'm trying to finish documenting one of my php applications and my client is particular about the documentation scheme. They want a header at the beginning of each file that looks something like this:


########################
# stuff here #
# more stuff here #
# Even more stuff here #
########################
(this forum destroys the whitespace....all the pound signs on the right have to align)

Is there any PHP/Perl/whatever script or something that will let me edit these easier than hitting space or tab billions of times, especially when changes need to get made?

cameraman

5:58 pm on Jun 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not aware of anything that would do that specifically, although there's several enterprise-type editors ($$$) that help with documentation, and there's the pear phpdocument project.

A php script that's not currently being executed is just a file like any other, though. You could easily write a script to fopen() other scripts and format the comment block. T'were me I'd do a form with a text area for the comments and echo the first part of the script just for reference below it. I'd type in the straight text that I wanted and my script would word-wrap at an arbitrary length and add the pound signs.

You could probably knock out a script like that in half an hour unless, like me, you get hung up on making the stupid thing look pretty ;) .