PHP Learning-Using Phpdocumentor 2 to generate API documentation _php Tutorial

Source: Internet
Author: User
Tags intl pear php source code xsl zend framework
Official Address: http://www.phpdoc.org/Project address: Https://github.com/phpDocumentor/phpDocumentor2

Phpdocumentor 2 is a program that can parse PHP source code and comment blocks and generate documents.

Inspired by Phpdocumentor 1 and Javadoc, it continues to innovate using a number of new technologies and features that support PHP.

Features of Phpdocumentor 2:

    • Compatible with php5.3, full support for namespaces and closures, and more.
    • Identify support for any tag, plus some additions (such as @link).
    • faster processing speed. The processing time of the Phpdocumentor 1 under the Zend Framework has been significantly reduced .
    • low memory consumption, the memory consumption of small medium and large projects is lower than 20MB,40MB and 100MB respectively.
    • Incremental parsing. If you have a Structure.xml file that was previously run by Phpdoc, then the speed at which the document will be rebuilt after a small modification is increased by 80%.
    • Simply create a template with 1 small steps and edit 3 files.
    • Compatible with the 1 generation command line. such as--directory,--file and--target
    • Two-step processing. First generate the structure file, you can format the relevant information according to this file, with your own tools to display information!

Installation Requirements:

    • PHP 5.3.3 or higher
    • Ext/iconv, http://php.net/manual/en/book.iconv.php (opens by default from PHP 5.0.0)
    • Ext/intl, http://php.net/manual/en/book.intl.php
    • The XSL extension, http://www.php.net/manual/en/book.xsl.php (optional, used only when using XSL templates)
    • Graphviz (optional, used to generate class diagrams)

Installing Phpdocumentor 2

1. Dependent on pear for installation:

Download Pear http:/pear. php. NET/go-pear.phar

Put the Go-pear.phar in the PHP directory

To execute the installation command :

PHP Go-pear.phar

The input system is executed below

And then all the way to the installation.

2. Next install the tools used for the class relationship drawing:

Install Image_graphviz

Download / http Www.graphviz.org/Down Load _ Windows . PHP Graphviz-2.38.msi

After installation, note that the path to the bin is added to the environment variable path.

The following is an important step: Restart the computer, otherwise it will not take effect

3. Installing Phpdocumentor

// Register Channel // list The versions you can get Install //

Detailed reference: http://pear.phpdoc.org/

Installation Steps Complete!

Hint below:

Two software after the installation of the directory are under PHP pear below:

    • Php/pear/phpdocumentor
    • Php/pear/image

Using Phpdocumentor 2

The following is the start of building the project document:

Under the PHP root directory:

Phpdoc-d Project Absolute path-T generates a path for the document to be stored
D represents the path directory,t represents target. Alternatively, you can select-F to specify a single file. Make a good path wait a moment and then you can see the description document in the target folder.

Example:

phpdoc-d E:\bak\video\code-t E:\bak\video\code\doc

E:\bak\video\code Folder for PHP code

E:\bak\video\code\doc the folder to generate the document

The specific parameters are as follows:

Project:run [-t|--target[=] [...]] [-f|--filename[=] ... "] [-d|--directory[=] ..."] [-e|--extensions[=] ... "] [-i|-- Ignore[= "..."] [--ignore-tags[=] [...]] [--hidden] [--ignore-symlinks] [-m|--markers[=] ... "] [--title[=] ..."] [-- Force] [--validate] [--visibility[=] ... "] [--defaultpackagename[=" ... "] [--sourcecode] [-p|--progressbar] [-- Template[= "..."] [--parseprivate] [-c|--config[= "..."]

http://www.bkjia.com/PHPjc/775953.html www.bkjia.com true http://www.bkjia.com/PHPjc/775953.html techarticle Official Address: http://www.phpdoc.org/Project address: Https://github.com/phpDocumentor/phpDocumentor2 Phpdocumentor 2 is a can Parsing PHP source code and comment blocks and generating documentation for the process ...

  • 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.