Linux command
phpdoc 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Generate documentation
phpdoc -d [src/] -t [docs/]
Specify config file
phpdoc -c [phpdoc.xml]
Generate with specific template
phpdoc -d [src/] -t [docs/] --template="clean"
Parse single file
phpdoc -f [file.php] -t [docs/]
说明
phpDocumentor (phpdoc) generates API documentation from PHP source code. It parses DocBlock comments to create navigable HTML documentation. The default command is `phpdoc run`, which can also be invoked simply as `phpdoc`. It supports configuration files (phpdoc.xml or phpdoc.dist.xml) for persistent settings and multiple output templates.
参数
- -d, --directory _path_
- Source directory.
- -f, --filename _file_
- Single file to parse.
- -t, --target _path_
- Output directory.
- -c, --config _file_
- Configuration file.
- --template _name_
- Template to use.
- --ignore _pattern_
- Patterns to ignore (supports globs, e.g., `"**/*test.php"`).
- --visibility _level_
- Filter by visibility: public, protected, private, api, or internal.
- --title _text_
- Set browser and template title.
- --encoding _encoding_
- Set file encoding (default: UTF-8).
FAQ
What is the phpdoc command used for?
phpDocumentor (phpdoc) generates API documentation from PHP source code. It parses DocBlock comments to create navigable HTML documentation. The default command is `phpdoc run`, which can also be invoked simply as `phpdoc`. It supports configuration files (phpdoc.xml or phpdoc.dist.xml) for persistent settings and multiple output templates.
How do I run a basic phpdoc example?
Run `phpdoc -d [src/] -t [docs/]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -d, --directory _path_ do in phpdoc?
Source directory.