PEAR: use PHPDoc to easily create your PEAR document

Source: Internet
Author: User
For a developer, the document is always one of the biggest headaches. Furthermore, you may take two very different attitudes towards Documents: when you use others' code libraries, what you want most is their technical documents, especially when the time is very tight and you have to read the raw code. When writing your own program

For a developer, the document is always one of the biggest headaches. In addition, you may take two very different attitudes towards the document:

When you use someone else's code library, what you most want is its technical documentation, especially when the time is tight, and you have to read the raw code.

When writing your own program, what you don't want to do most is to write a special technical document for it. you will excuse yourself for various reasons: my code is clear enough, so I don't have to re-compile the document for it anymore ......

To alleviate this conflict, many tools can help you to automatically generate corresponding api documents by extracting corresponding comments from the source code. Javadoc in java and pod2man in perl. In contrast, php seems to lack corresponding tools in the past. However, with the continuous improvement of phpdoc, this situation has greatly improved.

In the first pear encoding rule, annotations in the pear program should be converted by phpdoc. It can be seen that phpdoc does not play a small role in pear. Today, we will discuss in detail phpdoc, an excellent pear program.

PHPDoc is an excellent module under PEAR. it aims to implement functions similar to javadoc and quickly generate API documents with mutual reference and indexing functions for your code. If you have used documents generated by javadoc (such as jdk documents), you will be very clear that if you have not used them, the following is a phpdoc to generate its own document page:


 

As you can see from the figure, the documents generated by phpdoc are similar to those generated by JAVADOC. it has multiple indexing methods:
Packageindex: index by module
Classtree: this is based on the inheritance relationship of your php class. you can generate a tree index.
Modulegroups: this is divided by module
Elementlist: this is the alphabetic index of all your elements (class, method, process/function, variable)

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.