Search code examples
magentodocumentationphpdoc

How do I generate the API docs/documentation for Magento?


I have Magento installed and I wanted to know how to generate the full API docs, like the ones on http://docs.magentocommerce.com/ that were generated using phpdoc. Is there a configuration file included with Magento for phpdoc that I can use to generate the documentation?


Solution

  • The actual program is called phpDocumentor and you can use it on the command-line to document the core Magento code by using phpdoc -d $MAGENTO_PATH/app/code/core/Mage/ -t docs. Don't forget get to create a directory called docs, or you can set the target directory to whatever you want.

    To document the API of an extension you can use phpdoc -d $MAGENTO_PATH/app/code/local/$PACKAGE/$MODULE where $PACKAGE is the package name, and $MODULE is the name of the module, and $MAGENTO_PATH is where Magento is installed.

    Warning: it could take a while to generate all the API documentation as Magento is a pretty big program.