At the customer's requirement, a class diagram and class member description documents should be provided. This document was not included in the calculation. Therefore, the phpdoc format was used for delivery.
To avoid the same detours in the future, write down such information before the official start.
You must first install graphviz and then install phpdoc.
Phpdoc and xdoc (javadoc, ndoc ...) Similarly, generate HTML FormatProgramHelp documentation.
Graphviz is used to draw the dot language script description. After installing phpdoc, You can output a class chart.
The installation process is as follows:
1. phpdoc home page: http://www.phpdoc.org/
2. Execute:
Pear channel-discover pear.phpdoc.org
Pear install phpdoc/phpdocumentor-alpha
(For installation of pear, refer to another blog .)
3. Set the current directory to the directory for converting the doc, that is, your phpCodeDirectory.
Run
Phpdoc-D.-T c: \ docs
C: \ docs is the target path for generating phpdoc
The following error occurs:
The XSL writer was unableFindYour processing tprocessor; please checkIfYou have installed the php xsl Extension
The solution is as follows:
Obtain php_xsl (this file passed the test on php5.3.22) and add it to PhP. ini.
Extension = php_cmd.dll
4. Run again
Phpdoc-D.-T c: \ docs
OK. html format descriptions are generated under the c: \ docs directory.
5. However, check the execution result of phpdoc and find the following error on the command line terminal:
UnableFindThe 'dot'CommandOf the graphviz package.Is graphviz correctly installed and present in yourPath? UnableFindThe 'dot'CommandOf the graphviz package.Is graphviz correctly installed and present in yourPath?
Open the generated phpdoc and click the sub-menu under the charts menu. It is found that phpdoc will generate a class chart, but there is no way to implement it because I have not installed graphviz... Decide to fix it.
Graphviz Official Website: http://www.graphviz.org/
Download the installation package. With excitement, execute the phpdoc command again, OMG! It is still the original error prompt. You cannot wait to open the command line and click the "dot" command... Output The help information of dot, indicating that it has been installed. However, it's useless!
Run
Pear uninstall phpdoc/phpdocumentor-alpha
Uninstall phpdoc! Reload again! OMG! Phpdoc cannot be installed at the same time (at that time, I had a heart hitting the wall )! Error message:
No releases availableForPackage...
Calm down and carefully analyze the pear command parameters. One of the parameters is clear-cache, which may be because the pear caches the installation information. Therefore, phpdoc has been installed on the local machine. Run clear-Cache and reinstall phpdoc! Execute the Export command of phpdoc again! It indicates that the graphviz error cannot be found because of the installation sequence. You should first install graphviz and then install phpdoc to open the generated phpdoc, And the chart can be displayed normally! Oye!