Php document tool phpjavasentor installation and usage

Source: Internet
Author: User
Tags pear
This article mainly introduces how to install and use the php documentation tool phpbench entor. it analyzes in detail how to install and use phpbench entor on the Linux platform, for more information, see the following section. We will share this with you for your reference. The details are as follows:

PHP pluentor is a module under PEAR used to generate documents. The PHP generator entor scans the php source code under the specified directory, scans the keywords, captures the comments to be analyzed, analyzes the specific tags in the comments, and generates html files, then, based on the analyzed class and module information, create an index to generate an html file. It is useful in review code.

1. install PHP pluentor

First, check whether the pear Library is installed,

; UNIX: "/path1:/path2" include_path = ". :/usr/share/pear "// pear Library location; Windows:" \ path1; \ path2 "; include_path = ".; c: \ php \ shortdes"

If http://pear.php.net/go-pearis not installed, the file region is bytes. The php go-pear.php under the command line, you can install. I installed php with yum. during installation, pear has been installed. After installing pear, you can install phpdoc through pear install phpDocumentor.

[Apacheuser @ krlcgcms01 ~] $ Phpdoc-h contains many parameters. to generate an html document, three parameters are enough.

-D directory to be analyzed. multiple directories are separated by commas.
-T: storage path of the generated document
-O output document format

II. production documents

The code is as follows:

[Root @ krlcgcms01 test] # phpdoc-d "/tmp/test/mytest"-t "/tmp/test/doc"-o "HTML: frames: phpedit"

In the above sentence, the PHP file under the/tmp/test/mytest directory is generated and put under/tmp/test/doc. the document format is html.

[apacheuser@krlcgcms01 doc]$ lsblank.html elementindex.html li_首页.htmlclasstrees_default.html elementindex_首页.html mediaclasstrees_首页.html errors.html packages.htmldefault index.html 首页elementindex_default.html li_default.html

Go to the directory where the generated document is stored. The system does not contain Chinese characters, so Chinese characters are garbled.

Access the browser to download index.html.

PHP Documentor documentation tool

1. from this, we can see that the content in the document is mainly to list the annotation labels in the PHP file and the corresponding files, which looks quite comfortable. Nothing else.

The annotation label is as follows::

@ Author information
@ Const a constant defined by define
@ Deprecate APIs not recommended
@ Global variable
@ Package information
@ Param function parameters
@ Return value
@ See reference function
@ Since introduction time
@ Static variable
@ Var class member variables

2. if garbled characters exist, the generated html editing is

The code is as follows:


Changing it to gbk will not display garbled characters.

I hope this article will help you with PHP programming.

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.