Documentation Generator for PHP
PHP JavaScript XSLT HTML CSS Shell
Latest commit 722f704 May 19, 2017 @mvriel mvriel committed on GitHub Merge pull request #1830 from sloanlance/see-tag-inline
Added `@​see` inline example
Failed to load latest commit information.
bin upgrae package.php to phpdoc 3 Oct 9, 2016
data Fix typo in data/templates/clean/elements/constant.html.twig Oct 27, 2015
docs Merge pull request #1830 from sloanlance/see-tag-inline May 19, 2017
src Merge remote-tracking branch 'mbed67/project-mapper' into develop Dec 27, 2016
tests Fixes failing tests Dec 27, 2016
.gitattributes Spring cleanup before restarting the project Oct 8, 2016
.gitignore Moved installation of test tools to phing for ContinuousPHP Feb 20, 2016
.gitlab-ci.yml Adds gitlab-ci build pipeline config Oct 9, 2016
.scrutinizer.yml removed some excluded dirs and add ansible instead Aug 3, 2014 Merge branch 'master' into develop Feb 25, 2015 update contribution to inform people about different versions Dec 13, 2015
LICENSE Added parameter for setting the desired output format for transformat… Oct 6, 2010 Updated file with PHAR-based installation instructions Jul 29, 2016
VERSION Remove newline from VERSION Jul 7, 2015
box.json Update box.json to version 3 prepared Oct 9, 2016
build.xml Forgot to depend on the clean step Feb 20, 2016
composer.json Removes old composer scripts Oct 9, 2016
composer.lock Fixes failing tests Dec 27, 2016
package.xml Commit package file for 2.3.1 Feb 26, 2014
phpcs.xml Allow specific classes to break PSR2 class naming convention because … Mar 16, 2016
phpdoc.dist.xml adapted the configuration for test purposes Oct 10, 2015
phpmd.xml.dist Fixing type inference and variable length issues Jul 31, 2014
phpunit.xml.dist Add tests for CommandlineOptionsMiddleware and disable ContainerDefin… Feb 28, 2016

Build Status


What is phpDocumentor?

phpDocumentor an application that is capable of analyzing your PHP source code and DocBlock comments to generate a complete set of API Documentation.

Inspired by phpDocumentor 1 and JavaDoc it continues to innovate and is up to date with the latest technologies and PHP language features.


phpDocumentor supports the following:

  • PHP 5.3 compatible, full support for Namespaces, Closures and more is provided.
  • Shows any tag, some tags add additional functionality to phpDocumentor (such as @link).
  • Processing speed, Zend Framework experienced a significant reduction in processing time compared to phpDocumentor 1.
  • Low memory usage, peak memory usage for small projects is less than 20MB, medium projects 40MB and large frameworks 100MB.
  • Incremental parsing, if you kept the Structure file from a previous run you get an additional performance boost of up to 80% on top of the mentioned processing speed above.
  • Easy template building, if you want to make a branding you only have to call 1 task and edit 3 files.
  • Command-line compatibility with phpDocumentor 1, phpDocumentor 2 is an application in its own right but the basic phpDocumentor 1 arguments, such as --directory, --file and --target, have been adopted.
  • Two-step process, phpDocumentor first generates a cache with your application structure before creating the output. If you'd like you can use that to power your own tools or formatters!


phpDocumentor requires the following:

Note: If you do not want to install the Graphviz dependency you are encouraged to generate your own template and make sure that it does not contain anything related to Graph. An easier solution might be to edit data/templates/responsive/template.xml file and remove every line containing the word Graph but this will be undone with every upgrade of phpDocumentor.

Please see the documentation about creating your own templates for more information.


There are 3 ways to install phpDocumentor:

  1. Via PEAR (recommended)
  2. Via Composer
  3. Using the PHAR

Please note that it is required that the installation path of phpDocumentor does not contain spaces. This is a requirement imposed by an external library (libxml)

PEAR (recommended)

  1. phpDocumentor is hosted on its own PEAR channel which can be discovered using the following command:

     $ pear channel-discover
  2. After that it is a simple matter of invoking PEAR to install the application

     $ pear install phpdoc/phpDocumentor

Via Composer

  1. phpDocumentor is available on Packagist.

  2. It can be installed as a dependency of your project by running the following command.

     $ composer require --dev phpdocumentor/phpdocumentor

WINDOWS USERS you may encounter an error ZipArchive::extractTo(): Full extraction path exceed MAXPATHLEN (260) when trying to run the above command. If you do simply add --prefer-source at the end of the command.

Afterwards you are able to run phpDocumentor directly from your vendor directory:

$ php vendor/bin/phpdoc

Using the PHAR

  1. Download the phar file from, or from a release listed on github
  2. Move the file with sudo to your bin directory: sudo mv phpDocumentor.phar /usr/local/bin/phpdoc
  3. Ensure the file has execute rights: sudo chmod +x /usr/local/bin/phpdoc
  4. Confirm it runs (you may have to restart your SSH session if you're connecting remotely first) by running phpdoc --version from any directory.

How to use phpDocumentor?

The easiest way to run phpDocumentor is by running the following command:


This command will parse the source code provided using the -d argument and output it to the folder indicated by the -t argument.

phpDocumentor supports a whole range of options to configure the output of your documentation. You can execute the following command, or check our website, for a more detailed listing of available command line options.

$ phpdoc run -h

Configuration file(s)

phpDocumentor also supports the use of configuration files (named phpdoc.xml or phpdoc.dist.xml by default). Please consult the documentation to see the format and supported options.


For more detailed information you can check our online documentation at

Known issues

  1. phpDocumentor must be installed in a path without spaces due to restrictions in libxml. The XSL transformation will throw all kinds of odd warnings if the path contains spaces.


If you would like to help out financially we accept donations using gittip. All donations will be used to cover the costs for hosting phpDocumentor's website and PEAR repository.


To come in contact is actually dead simple and can be done in a variety of ways.