【发布时间】:2017-03-24 14:25:10
【问题描述】:
我知道 PHP ReflectionClass 可以从 PHP 脚本中获取 doc cmets。现在我遇到了数百个不使用类而只使用简单公共函数的旧 PHP 脚本。如果我是对的,ReflectionClass 不能在这里使用吗?我的目标是提取每个文档 cmets。例如。 test1.php 包含以下几行:
<?php
/**
* some main comments here
*/
...some php lines here...
/**
* function comment
* Blah blah
*/
function foo()
{
...some php lines here...
}
...and more functions below each with comments
?>
所以我想要的输出是这样的表格:
--------------------------------------------------
| Filename | FUNCTION | Comment |
--------------------------------------------------
| test1.php | | some main comments here |
| test1.php | foo() | function comment |
| | | Blah Blah |
【问题讨论】:
-
您尝试过一些文档生成器吗? phpdox.de 或 phpdoc.org
-
穆埃沙,谢谢。还没有。如果您能进一步提示我,我将不胜感激:)
标签: php