如何忽略phpDocumentor中的特定文件

如何忽略phpDocumentor中的特定文件,php,documentation,phpdoc,Php,Documentation,Phpdoc,我正在用phpDocumentor编写一个用PHP构建的程序。一切都很完美,但是文档显示我有将近100个错误,因为它正在读取一个我用来上传文件到服务器的文件,但我没有创建。 是否可以忽略给我所有错误的特定文件?这是我正在执行以生成文档文件的命令: phpdoc run -d /var/www/html/myprogram/ -t /var/www/html/myprogram/documentation 我试图忽略的文件位于/myprogram目录中,如下所示: /modules/module

我正在用phpDocumentor编写一个用PHP构建的程序。一切都很完美,但是文档显示我有将近100个错误,因为它正在读取一个我用来上传文件到服务器的文件,但我没有创建。 是否可以忽略给我所有错误的特定文件?这是我正在执行以生成文档文件的命令:

phpdoc run -d /var/www/html/myprogram/ -t /var/www/html/myprogram/documentation
我试图忽略的文件位于
/myprogram
目录中,如下所示:

/modules/module1/uploader.php
我找到了一些关于使用
--ignore
的信息,但我不知道这是否与目录有关

是否可以在
index.php
文件中写入指示phpDocumentor忽略某些文件的内容?

将接受单个文件名(以及目录名或glob表达式):

或者,由于它将接受部分目录,因此可以将其缩短为:

phpdoc run --ignore modules/module1/uploader.php -d /var/www/html/myprogram/ -t /var/www/html/myprogram/documentation
我希望我的答案不会被否决。我把我的答案写在这里,供将来参考,也供其他可能从中受益的人参考

在项目的根目录中创建
phpdoc.xml
配置文件有很大帮助,而不是因为包含多个include/ignore选项而使命令复杂化。您可以轻松地将文件中所有必需的选项组合在一起,
phpdoc
将读取这些选项,以帮助构建文档

例如,我的项目的
phpdoc.xml
配置文件如下所示,其中包含
phpdoc
选项:

<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
    <title>App Plugins Documentations</title>
    <parser>
        <target>reference/docs</target>
    </parser>
    <transformer>
        <target>reference/docs</target>
    </transformer>
    <files>
        <directory>.</directory> <!-- Scan and parse all the php files except those found in the paths below -->
        <ignore>assets/*</ignore>
        <ignore>includes/gm-virtual-pages/*</ignore>
        <ignore>includes/app_virtual_pages/*</ignore>
        <ignore>includes/third-party/*</ignore>
        <ignore>includes/vendor/*</ignore>
        <ignore>reference/docs/*</ignore>
        <ignore>storage/*</ignore>
        <ignore>views/*</ignore>
        <ignore>index.php</ignore> <!-- Ignore all the index.php files -->
    </files>
</phpdoc>

只需在项目根目录中运行
phpdoc
命令,其中包含
phpdoc.xml
配置文件。

感谢您的帮助,第二个为我完成了任务:D
<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
    <title>App Plugins Documentations</title>
    <parser>
        <target>reference/docs</target>
    </parser>
    <transformer>
        <target>reference/docs</target>
    </transformer>
    <files>
        <directory>.</directory> <!-- Scan and parse all the php files except those found in the paths below -->
        <ignore>assets/*</ignore>
        <ignore>includes/gm-virtual-pages/*</ignore>
        <ignore>includes/app_virtual_pages/*</ignore>
        <ignore>includes/third-party/*</ignore>
        <ignore>includes/vendor/*</ignore>
        <ignore>reference/docs/*</ignore>
        <ignore>storage/*</ignore>
        <ignore>views/*</ignore>
        <ignore>index.php</ignore> <!-- Ignore all the index.php files -->
    </files>
</phpdoc>
<ignore>/modules/module1/uploader.php</ignore>