Project Links

Sourceforge project page:
http://sourceforge.net/projects/phpdoctor/
File download:
http://prdownloads.sourceforge.net/phpdoctor/phpdoc-1.4.tar.gz?download
Browse CVS:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpdoctor
Anonymous CVS:
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/phpdoctor

Description

PHPDoctor is a Javadoc style comment parser for PHP, written with an emphasis on speed and simplicity. It is not as fully featured as other PHPDoc programs, but is simple to configure, use, and extend.


Requirements

PHP 4.3.0+ is required due to use of the PHP tokenizer extension. The tokenizer is built into PHP 4.3.0 by default, this program may work with older versions of PHP with the tokenizer extension enabled but it has not been tested and you are recommended to upgrade to 4.3.0+ for using this program.


Features


Q&A

Q: Why do we need another Javadoc clone for PHP?

A: I wrote PHPDoctor because I couldn't find a Javadoc clone for PHP that was small and simple and worked out of the box without having to understand how numerous templating engines work, or that worked correctly on my code. The PHP tokenizer extension has made creating PHPDoc programs really easy since PHP can now do the hard work for you.

Q: Why is phpdoctor different from other PHPdoc programs?

A: PHPDoctor is very small and easy to use, even the templating layer it uses for output generation is small and simple to understand. PHPDoctor has a very small learning curve, most people should be able to generate API documentation in only a few minutes.

Q: Tell me more about how PHPDoctor works

A: PHPDoctor uses the PHP tokenizer extension, this means that it lets PHP do the parsing of your source code. PHPDoctor just takes the tokens PHP parses out and turns them into API documentation. This means it will work for any PHP code, no exceptions, it also makes it very fast. The down side of this is that it needs PHP 4.3 or above to work.


Installation

Unzip the archive somewhere, edit the default config file and then run phpdoc.php with your CLI version of PHP.


Files


Usage

phpdoc.php <config_file>

If you are using MS Windows and don't have the .php file type registered with the PHP CLI executable, you will need to call the PHP executable explicitly as in:

c:\php\cli\php.exe phpdoc.php <config_file>

To create a config file for your project, copy the default.ini file and edit it to your needs, it's fully commented.


Configuration

PHPDoctor supports a number of configuration directives:


Doc Comments

A full description of the format of doc comments can be found on the Sun Javadoc web site. Doc comments look like this:

 /**
  * This is the typical format of a simple documentation comment
  * that spans two lines.
  */

Note the extra asterisk after the opening comment line.


Tags

PHPDoctor supports most of the Javadoc tags defined by Sun. The following tags are supported:

Some Javadoc tags are not relevant to PHP and so are ignored, others are added or slightly changed due to PHPs loose typing:


Feedback And Comments

If you find PHPDoctor useful, have found a bug, or want to request a feature, please get in touch either via e-mail or through our Sourceforge project page.


Copyright And License

The information below applies to everything in this distribution, except where noted.

Copyright 2004 by Paul James.

paul at peej.co.uk
http://www.peej.co.uk/

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License along
with this program (COPYING); if not, go to http://www.fsf.org/ or write
to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.