Phpdoc getting started

Source: Internet
Author: User

Phpdoc getting started


1. Download

Download phpdocat http://sourceforge.net/projects/phpdocu/files/and my website is 1.4.3.



2. Use

After decompression, the terminal: phpdoc-h can view all the commands and select several important ones:

-D path of the source PHP File

-T storage path of the generated document (it is best to create a folder for it)

-Name of the DN package (default by default, preferably the project name)

-Name of the DC directory (default, preferably the project name)

-Ti document title: This is the title of the homepage.

-O: The template format of the generated document. There should be many options, but I only choose: HTML: smarty: PhP (beautiful feeling)



3.

Annotation rules (in fact, they are similar to most document generation tools, such as javadoc, doxygen, and jsdoc)

The following parts are organized from the network:

Note: phpdoc is different from other automated document generation tools. You cannot add HTML code to comments!

1.

Start with each PHP file:

/*** Common base class of all phpdoc classes (in brief, only one row should be occupied in the index List) ** as a kind of common base class phpdocobject holds * configuration values (e.g. error Handling) and debugging * methods (e.g. introspection ()). it does not have a constructor, * so you can always inheritig phpdoc classes from this * class without any trouble. (For detailed function description, multiple lines are supported) ** @ author Ulf Wendel * @ version $ ID: phpdocobject. PHP, V 1.3 2001/02/18 15:29:29 UW exp $ * @ package phpdoc (document tag) (you can put different modules in different packages, A package list is automatically generated when a document is generated. You can select different packages in the upper left corner of the document to view different module documents )*/

The following is a phpdoc canonicalized comment:





4. Generate the document:

After writing the standard annotations, the following documents must be generated:

Example:

Phpdoc-D./A-T./B-DN ABC-DC def-Ti XYZ-O HTML: smarty: PHP

The above indicates: Yes. the PHP file generated in/A is stored in. in the/B directory, the package name is ABC, the directory name is def, and the title is xyz. The template is HTML: smarty: PHP.



5. Problems:

When a document is generated, the following warning may appear in the generated document because the time zone is not set:

Warning: strftime (): it is not safe to rely on the system's timezone settings. you are * required * to use the date. timezone setting or the date_default_timezone_set () function. in case you used any
Of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we selected 'Asia/Chongqing 'For 'cst/8.0/No DST' instead in/home/hudao/php?entor/files/PhpDocumentor-1.4.3/PhpDocumentor-1.4.3/php?entor/smarty-2.6.0/libs/smarty_compiler.class.php
On line 370

Solution:

Follow the warning prompt to open the smarty_compiler.class.php file, and then in the second line (the first line is <? PHP) join:

Date_default_timezone_set ('Asia/Shanghai'); // 'Asia/Shanghai' Asia/Shanghai

The above indicates manually selecting a Time Zone

Then run the command in step 4 ~~~




Done!

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.