Phpdocumentor 2 How to install and generate API documentation _php Tips

Source: Internet
Author: User
Tags intl pear php source code xsl zend framework

Website address: http://www.phpdoc.org/
Project Address: Https://github.com/phpDocumentor/phpDocumentor2

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

Inspired by Phpdocumentor 1 and Javadoc, it continues to innovate with new technologies and features that support PHP.

Features of Phpdocumentor 2:

Compatible with php5.3, full support for namespaces and closures.
Identify support for any tag, and some additions (such as @link).
Faster processing speed. The processing time of Phpdocumentor 1 under the Zend Framework has been significantly reduced.
Low memory consumption, small medium large project memory consumption 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 of rebuilding the document after a small change will increase by 80%.
Simple to create a template, just 1 small steps and edit 3 files.
A command line that is compatible with 1 generations. such as--directory,--file and--target
Two-step processing. First generate structure file, you can according to this file to format the relevant information, using their own tools to display information!

Installation Requirements:

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

Install Phpdocumentor 2

1. Rely 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:

Copy Code code as follows:

PHP Go-pear.phar

The input system is executed below

And then all the way to the carriage.

2. Next installs the tool that the class relational drawing uses:

Copy Code code as follows:

Pear Install Image_graphviz

Download http://www.graphviz.org/Download_windows.php Graphviz-2.38.msi

After installation, note whether the path to the bin has been added to the environment variable path.

Here's a very important step: Reboot the computer, or it won't take effect.

3. Install Phpdocumentor

Copy Code code as follows:

Pear channel-discover pear.phpdoc.org//Registration Channel
Pear remote-list-c phpdoc//list of available versions
Pear Install phpdoc/phpdocumentor//Installation Phpdocumentor

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

Installation Steps Complete!

Hint below:

The two software installed directories are under the following pear under PHP:

Php/pear/phpdocumentor
Php/pear/image

Using Phpdocumentor 2

The following starts to build the project document:

Under the PHP root directory:

Copy Code code as follows:

Phpdoc-d the path to the document that was generated by the absolute path-T of the project

D represents the path directory,t representing target. Or you can select-F to specify a single file. Make a good path. You can see the documentation in the target folder as soon as you have completed the execution.

Example:

Copy Code code as follows:

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 to the folder where the document is generated

The specific parameters are as follows:

Copy Code code 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[= ...]]

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.