views:

34

answers:

3

I know that PHPDoc exists, but phpdoc wants you to put comments in your PHP files so that it can parse them...

What I want is something different: Suppose that I have 10 PHP classes... all I want is a script that can read those classes and automatically generate a representation of those class structures, i.e. what classes are in them, properties, methods, etc, and organize that information in an easy to follow format...

Do any of you know any script that does this automatically?

A: 

There are scripts that don't require comments, for example: Doxygen.

You can configure doxygen to extract the code structure from undocumented source files.

Sagi
A: 

PHP has built-in reflection classes. Try something like this:

ReflectionClass::export($classname);

More info here: http://www.php.net/manual/en/book.reflection.php

no
A: 

Since you say up front that you don't actually want the kinds of info that you'd normally write in a docblock, I assume you only want the "intelligence" that you can glean from seeing the code itself. phpDocumentor can still do this for you.

You still get the files, classes, constants, functions, methods, etc all documented. There just won't be the additional intelligence available that you'd normally put into the docblock itself. In short, I think phpDocumentor's results, being solely code-based, would work for the needs you describe.

ashnazg