I'm doing some home-brewed automated documentation, since I have a codebase which is not very standard in its layout, and I was wondering what the best way was to read a PHP file and grab the contents of a comment block. The only way I can think to do it is to open the file and read it line-by-line, but thought that maybe there was some built-in magic that would parse the document for me, similar to the Reflection functions.
The basic layout of each file is like this:
<?php // $Id$
/**
* Here is this script's documentation, with information in pseudo-javadoc
* type tags and whatnot.
*
* @attr something some information about something
* @attr etc etc etc
*/
// rest of the code goes here.
It's important to note that these files don't have any functions or classes defined in them. The comments relate to the script as a whole.