There is a saying: Software = code + documentation. The importance of the document is visible! Documents are particularly important, especially when large and medium-sized projects and/or teams collaborate on code. Staff handover and team communication are hard to imagine only code and no documentation. Even if it is a person's code, it is time-consuming and time-consuming to read your previous code.
However, organizing and preparing documents is boring and boring. Especially when the project is busy, the earliest concession and sacrifice must be the preparation of documents.
Fortunately, there are some document-assisted writing tools that can help us a lot. php?entor is a good auxiliary tool for document compilation.
Phpdocumentor was first used for reference and porting from javadoc to the PHP environment and has become one of the excellent document auxiliary tools.
Phpdocumentor is distributed as pear extension class libraries and needs to be downloaded and installed using the pear management tool.
The installation command is:
Pear install -- alldeps php‑entor
The -- alldeps parameter indicates that other pear class libraries dependent on phpbench entor are downloaded and installed at the same time.
Use of phpdocumentor:
When writing code, you must use the agreed format (very important!) in the PHP file, class, member variable, member function, and other parts !), Comments the code. Phpdocumentor can generate final documents based on the syntax features of the Code and the agreed annotation format. The document is saved in HTML format for online publishing and browsing.
The common format of comments for a document is:
Identification file:
/**
* @ Licens ......
* @ Package ......
* [Comment ......]
* @ Author ......
* @ Copyright
*/
Identify member variables:
/**
* [Comment ......]
* @ Var string/INT/Array
*/
Identify member functions:
/**
* [Comment ......]
* @ Param ......
* @ Return ......
* @ Author ......
* @ Copyright
*/
The DOS/shell command used to generate the document is:
Phpdoc-D <folder containing code>-T <save the folder of the generated document>
This command is flexible, and other parameters are used to generate documents of different levels of detail.
Author: Zhang Qing (mesh) Xi'an PHP Education Training Center
From mesh horizon: http://blog.why100000.com
Author Weibo: http://t.qq.com/zhangking
Why 100,000 computer learning networks: http://www.why100000.com