9 Steps to PHP Documentation Heaven

  1. Download PHPDocumentor and uncompress it into a directory inside your web root.
  2. Access the web interface by going to phpdoc.php in the newly extracted directory
  3. Enter the directory you would like to document
  4. Enter the directory the output should appear in (this needs to exist and be writable by the user your web server runs as)
  5. Choose a template! My favourite is the HandS one, but there are others and you can create your own later on
  6. Press the create button
  7. If your code wasn’t already documented correctly then there might not be a lot to see at this point. Go to the PHPDocumentor tutorial to find out how your commented code can become shiny documentation you can use to blind your manager with science to empower knowledge-sharing within your team
  8. Regenerate the documentation
  9. Get the rest of your team to comment their code correctly

Now repeat steps 8 and 9 many times until you have beautiful documentation.

3 thoughts on “9 Steps to PHP Documentation Heaven

  1. I downloaded and installed PHPDocumentor sometime last year, but didn't get very far with it due to lack of substantial project to give it a whirl on. Now I have a project, so thanks for the timely reminder!

  2. dotjay - grab a new version and try out the web tool, I've been bogged down with getting PHPDocumentor working before but this was an absolute breeze.

    • Sorry for reviving an old thread.

      I'm in the process of trying to transition from being a solo developer (with my own quite poor code commenting and documenting!) to working with other developers so need to be more disciplined and use better tools. I'm now using GIT and Bitbucket for version control but need to improve my documenting too. Is PHPDocumentor still the go-to app for documenting PHP code or are there better alternatives now in 2015?

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.