使用phpdoc生成类的说明文档

安装phpdocphp

pear install PhpDocumentor

经常使用的phpdoc命令参数html

-f 要进行分析的文件名,多个文件用逗号隔开.net

-d 要分析的目录,多个目录用逗号分割日志

-t 生成的文档的存放路径code

-o 输出的文档格式,结构为输出格式:转换器名:模板目录htm

以我开发的日志类为示例:ip

phpdoc -o HTML:frames:earthli -f Logger.php -t /doc

访问doc中的index.html便可以看到文档。pdo


phpdoc规范中有不少标签,通常使用几个经常使用的标签便可方便的阅读,具体以下:开发

@access private|public|protect 类的访问权限文档

@param integer|string|array|... 方法参数的类型

@return integer|string|array|... 返回值的类型

@var integer|string|array|... 类变量的类型


具体代码和文档说明点击这里下载。

相关文章
相关标签/搜索