我的项目中有一堆我试图忽略的文件夹。不幸的是,phpDocumentor 似乎试图访问某些文件夹并出现“权限被拒绝”错误。
Parsing C:\Users\Public\xampp\htdocs\select_user.php
PHP Warning: file_get_contents(C:\Users\Public\xampp\htdocs\sql): failed to open stream: Permission denied in C:\Program Files\PHPStorm\PhpStorm 2017.2\plugins\phpdoc\phpDocumentor-2.9.0\vendor\phpdocumentor\reflection\src\phpDocumentor\Reflection\FileReflector.php on line 138
Parsing C:\Users\Public\xampp\htdocs\sql
Parsing C:\Users\Public\xampp\htdocs\table_plan.php
PHP Warning: file_get_contents(C:\Users\Public\xampp\htdocs\tasks): failed to open stream: Permission denied in C:\Program Files\PHPStorm\PhpStorm 2017.2\plugins\phpdoc\phpDocumentor-2.9.0\vendor\phpdocumentor\reflection\src\phpDocumentor\Reflection\FileReflector.php on line 138
PHP Warning: file_get_contents(C:\Users\Public\xampp\htdocs\vendor): failed to open stream: Permission denied in C:\Program Files\PHPStorm\PhpStorm 2017.2\plugins\phpdoc\phpDocumentor-2.9.0\vendor\phpdocumentor\reflection\src\phpDocumentor\Reflection\FileReflector.php on line 138
Parsing C:\Users\Public\xampp\htdocs\table_users.php
Parsing C:\Users\Public\xampp\htdocs\tasks
Warning: file_get_contents(C:\Users\Public\xampp\htdocs\tasks): failed to open stream: Permission denied in C:\Program Files\PHPStorm\PhpStorm 2017.2\plugins\phpdoc\phpDocumentor-2.9.0\vendor\phpdocumentor\reflection\src\phpDocumentor\Reflection\FileReflector.php on line 138
Parsing C:\Users\Public\xampp\htdocs\unlock_appraisal.php
Parsing C:\Users\Public\xampp\htdocs\util.php
Parsing C:\Users\Public\xampp\htdocs\vendor
我试图通过排除这些目录phpdoc.dist.xml
。
<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
<parser>
<target>docs/phpdoc</target>
</parser>
<transformer>
<target>docs/phpdoc</target>
</transformer>
<files>
<directory>*</directory>
<file>*</file>
<ignore>test/*</ignore>
<ignore>assets/*</ignore>
<ignore>doc/*</ignore>
<ignore>docs/*</ignore>
<ignore>examples/*</ignore>
<ignore>html_sources/*</ignore>
<ignore>logs/*</ignore>
<ignore>vendor/*</ignore>
<ignore>vendor/</ignore>
<ignore>debug</ignore>
<ignore>_do_this_for_troubleshooting/*</ignore>
<ignore>*.pdf</ignore>
<ignore>*.md</ignore>
<ignore>*.json</ignore>
<ignore>*.lock</ignore>
<ignore>*.xml</ignore>
</files>
</phpdoc>
忽略列表的工作方式是排除文件夹内的项目是豁免的,但是文件夹本身不是。因此,phpDocumentor 尝试将文件夹作为文件读取,从而导致错误。这些在最终的 HTML 中也可见。
如何正确忽略文件夹?我知道我可以尝试使用--ignore sqlbuddy/,docs/
,但是我很确定它与ignore
在配置中使用 XML 标记相同。此外,我宁愿将忽略列表放在一个中央文件中,也不愿有两个单独的位置——一个在命令中,一个在配置 XML 中。
再次阅读我的问题后,我发现问题可能与此有关:
<directory>*</directory>
<file>*</file>
还有一个有趣的配置文档,我已经阅读了很多次,但它似乎并没有解决我的具体问题。