phpdoc注释格式及文档生成

旧版本使用步骤

1、win下安装pear

$file = 'http://pear.php.net/go-pear.phar';
$file2 = 'f:\go-pear.phar';
// Open the file to get existing content
$current = file_get_contents($file);
// Write the contents back to the file
将go-pear.phar复制到php.exe同目录下,cd进入该目录,执行php -d phar.require_hash=0 go-pear.phar命令,选择local,一路enter,完成后,该目录下会出现pear有关的目录和bat文件。

 

2、以phpdocumentor为例使用pear

Pear install phpDocumentor

 

3、命令生成

phpdoc -d "f:\phpdoc\1" -t  "f:\phpdoc\doc"  -o "HTML:frames:phpedit"

 

新版本使用步骤(v3.1.2)

1.php >=7.2;

2.下载phpDocumentor.phar文件,放在php同目录下即可

3.执行文档生成命令php phpDocumentor.phar -d f:\myproject\ -t f:\docs\ #注意目录不带引号


常用命令:-d,-t,-f
-d指出项目代码目录;
-f指出代码文件;
-t指出输出目录;

执行无误后,会在-t目录下生成对应的html文档文件。




v3.1.2文档注释格式



posted @ 2018-04-20 12:00  love/coder  阅读(467)  评论(0编辑  收藏  举报