- 安装命令
- PHP 5.3.3
- XSL extension for PHP, only applicable when generating HTML via XSL (生成html) ,如果是wamp 直接开启extension=php_xsl.dll 就行
- Graphviz, only applicable when generating Graphs (画图片)
-
下载并安装phpDocumentor生成类图需要的软件graphviz
http://www.graphviz.org/Download_windows.php
pear install Image_GraphViz
pear clear-cache
#(更新pear)
$ pear channel-discover pear.phpdoc.org $ pear install phpdoc/phpDocumentor-beta
$ phpdoc
-
-t|–target[=”...”]
- 存放生成的文档的 目录 -f|–filename[=”...”]
-
解析的文件名
-d|–directory[=”...”]
-
源码目录
–encoding[=”...”]
- ??? -e|–extensions[=”...”]
- ??? -i|–ignore[”...”]
- Provide a comma-seeparated list of paths to skip when parsing. –ignore-tags[=”...”]
- ??? –hidden
- ??? –ignore-symlinks
- Tells the parser to not follow symlinks. -m|–markers[=”...”]
- Provide a comma-separated list of markers to parse. –title[=”...”]
-
Specify a title for the documentation.
Title defaults to “phpDocumentor”.
–force
- Ingore exceptions and continue parsing. –validate
- ??? –visibility[=”...”]
-
Provide a comma-separated list of visibility scopes to parse.
This parameter may be used to tell phpDocumentor to only parse public properties and methods, or public and protected.
–defaultpackagename[=”...”]
-
–sourcecode
-
Starting with 0.16.0, Stores the sourcecode of each file with the structure.
When this parameter is provided the parser will add a compressed, base64-encoded version of the parsed file’s source as child element of the<file> element. This information can then be picked up by the transformer to generate a syntax highlighted view of the file’s source code and even have direct links to specific lines.
Currently the transformer will add a link to the given file’s source next to the name of the file in the top. In the future we will add direct links from elements to the line in this source code file.
-p|–progressbar
-
While running, show a short summary of generation progress.
When this parameter is provided the default lengthy command line output is replaced with a short overview of the generation status.
–template[=”...”]
- Specify a template name, or a path to a directory where a custom template resides. –parseprivate
- Parse items marked with @internal despite their visibility. -c|–config[=”...”]
- Config file to use when parsing.
<transformer>
<!-- Api文档存放目录 -->
<target>Api/html</target>
</transformer>
<!-- 模板,phpdocment 提供了多套模板,名称为:abstract,checkstyle,new-black,old-ocean,responsive,zend-->
<transformations>
<template name="new-black" />
</transformations>
<!-- 日志配置,注释错误或其他错误信息会记录到下面的文件 -->
<logging>
<level>warn</level>
<paths>
<default>{APP_ROOT}/Api/log/{DATE}.log</default>
<errors>{APP_ROOT}/Api/log/{DATE}.errors.log</errors>
</paths>
</logging>
<!--注释文件,phpdoc 默认会读取php 后缀的文件 -->
<files>
<!--<file>test.php</file>-->
<!--<file>bin/*</file>-->
<file>src/Services/LadingService.class.php</file>
<file>src/Services/LogService.class.php</file>
<file>src/Services/ReceiptService.class.php</file>
<file>src/Services/ServiceClientService.class.php</file>
<file>src/Services/StockService.class.php</file>
<file>src/Services/UserService.class.php</file>
<directory>src/Web/*</directory>
<directory>src/Cli/*</directory>
<!--忽略目录-->
<ignore>src/ThinkCommon/*</ignore>
<ignore>src/ThinkPHP/*</ignore>
<ignore>src/Upload/*</ignore>
<ignore>src/Runtime/*</ignore>
<ignore>src/Scripts/*</ignore>
<ignore>src/Vendor/*</ignore>
</files>
</phpdoc>
<parameters>
<variables>
<section.dashboard.show>false</section.dashboard.show>
<section.api.show/>
<section.namespaces.show>false</section.namespaces.show>
<section.packages.show/>
<section.files.show/>
<section.files.show-elements/>
<section.reports.show />
<section.charts.show />
</variables>
</parameters>
</transformation>