2

I'm looking to convert PHPDocumentor output to a format I can traverse through in PHP (Ideally, I want an array of all the functions with their comments).

Is there any way to do this?

3 Answers 3

4

You can use pure php reflection to get the phpdoc content. We used that to put there input validation data. I'll look up example code later.

Just use this:

$data = new ReflectionMethod($class, $method);
echo $data->getDocComment();
Sign up to request clarification or add additional context in comments.

Comments

2

Zend_Reflection might be of some use: http://framework.zend.com/manual/en/zend.reflection.reference.html

Comments

0

Another option would be to use the parse option of DocBlox to generate a XML structure which you can then interpret with your own code.

After you have installed DocBlox using PEAR you can use the following command to generate a structure.

docblox parse -d [SOURCE_FOLDER] -t [TARGET_LOCATION]

or

docblox parse -f [SOURCE_FILE] -t [TARGET_LOCATION] 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.