ot;);
这是定义换行的标志,dos下面是换行+回车,unix下面只是回车就可以。
下面,为你的要生成文档的应用程序做一些定制工作:
// sets the name of your application.
// the name of the application is used e.g. as a page title
$doc->setapplication("phpdoc");
setapplication()用来设置你的应用程序的名称,将phpdoc替换成你应用程序的名字。
// directory where your source files reside:
$doc->setsourcedirectory(phpdoc_include_dir);
setsourcedirectory()设置你的应用程序的php源文件所在的目录,将phpdoc_include_dir替换成你实际的目录。
// save the generated docs here:
$doc->settarget(phpdoc_include_dir."apidoc/");
settarget()设置你的api文档存放的目录,phpdoc将在这个目录下面生成xml及html文件。将phpdoc_include_dir."apidoc/"替换成你自己的目录。
// use these templates:
$doc->settemplatedirectory(phpdoc_include_dir."renderer/html/templates/");
settemplatedirectory()设置html所使用的模板的目录。如果你需要使用定制的模板,可以使用这个函数设置你自己的模板文件所在的目录。
// source files have one of these suffixes:
$doc->setsourcefilesuffix( array ("php", "inc") );
setsourcefilesuffix()用来设置需要分析的php源文件的扩展名,如果你使用了别的扩展名,需要在这里添加,比如如果你有以前的php3文件,需要添加:
$doc->setsourcefilesuffix( array ("php", "inc","php3") );
这样,基本的定制工作就完成了,现在你可以在浏览器中运行index.php,出现了欢迎信息后,就是开始分析文档了.根据机器的状况和所分析的源代码文件的数量不同,文档分析过程所需的时间也不会相同.文档分析结束后,浏览器会显示finish的字样,表明分析完成,你可以在刚才指定的目录下面找到分析结果,包括html和xml文件.
5.3 实用工具
通过phpdoc的index.php虽然可以产生文档,但是毕竟不是那么方便,这里我给出了一个自己写的shell程序 makeapidoc ,你可以用它来方便的产生你的api文档,无须每次都要修改,也不用非要启动浏览器来执行。
用法如下:makeapidoc -t 你的应用程序的标题 -s 源程序目录 -
这是定义换行的标志,dos下面是换行+回车,unix下面只是回车就可以。
下面,为你的要生成文档的应用程序做一些定制工作:
// sets the name of your application.
// the name of the application is used e.g. as a page title
$doc->setapplication("phpdoc");
setapplication()用来设置你的应用程序的名称,将phpdoc替换成你应用程序的名字。
// directory where your source files reside:
$doc->setsourcedirectory(phpdoc_include_dir);
setsourcedirectory()设置你的应用程序的php源文件所在的目录,将phpdoc_include_dir替换成你实际的目录。
// save the generated docs here:
$doc->settarget(phpdoc_include_dir."apidoc/");
settarget()设置你的api文档存放的目录,phpdoc将在这个目录下面生成xml及html文件。将phpdoc_include_dir."apidoc/"替换成你自己的目录。
// use these templates:
$doc->settemplatedirectory(phpdoc_include_dir."renderer/html/templates/");
settemplatedirectory()设置html所使用的模板的目录。如果你需要使用定制的模板,可以使用这个函数设置你自己的模板文件所在的目录。
// source files have one of these suffixes:
$doc->setsourcefilesuffix( array ("php", "inc") );
setsourcefilesuffix()用来设置需要分析的php源文件的扩展名,如果你使用了别的扩展名,需要在这里添加,比如如果你有以前的php3文件,需要添加:
$doc->setsourcefilesuffix( array ("php", "inc","php3") );
这样,基本的定制工作就完成了,现在你可以在浏览器中运行index.php,出现了欢迎信息后,就是开始分析文档了.根据机器的状况和所分析的源代码文件的数量不同,文档分析过程所需的时间也不会相同.文档分析结束后,浏览器会显示finish的字样,表明分析完成,你可以在刚才指定的目录下面找到分析结果,包括html和xml文件.
5.3 实用工具
通过phpdoc的index.php虽然可以产生文档,但是毕竟不是那么方便,这里我给出了一个自己写的shell程序 makeapidoc ,你可以用它来方便的产生你的api文档,无须每次都要修改,也不用非要启动浏览器来执行。
用法如下:makeapidoc -t 你的应用程序的标题 -s 源程序目录 -
| 对此文章发表了评论 |
