Use phpjavasentor to create a source program document

Source: Internet
Author: User

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
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.