How to ignore specific files in phpDocumentor

I am documenting a program built into PHP with phpDocumentor. Everything works fine, but the documentation shows me that I have almost 100 errors, because I read the file that I use to upload files to my server, but I did not create it. Is it possible to ignore this particular file that gives me all the errors? This is the command that I run to create the documentation file:

phpdoc run -d /var/www/html/myprogram/ -t /var/www/html/myprogram/documentation 

The file I'm trying to ignore is inside the /myprogram as follows:

 /modules/module1/uploader.php 

I found some information about using --ignore , but I don't know if this is something specific to directories.

Is it possible to write something in the index.php file that instructs phpDocumentor to ignore some files?

+4
source share
2 answers

--ignore flag will accept one file name (as well as the names of directories or glob expressions):

 phpdoc run --ignore /var/www/html/myprogram/modules/module1/uploader.php -d /var/www/html/myprogram/ -t /var/www/html/myprogram/documentation 

Or, since it will accept a partial directory, it can be shortened to:

 phpdoc run --ignore modules/module1/uploader.php -d /var/www/html/myprogram/ -t /var/www/html/myprogram/documentation 
+6
source

I hope my answer does not go down. I include my answer here for future reference and for others who may benefit from this.

Creating the phpdoc.xml configuration file in the project root directory helps to greatly complicate the commands by including several include / ignore parameters in it. You can easily compile all the necessary parameters in a file that phpdoc will read to help create documentation.

For example, the phpdoc.xml project configuration file looks like this: phpdoc options:

 <?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> 

This way you can include / ignore multiple paths and files; even specific files, as in your question. All you have to do is enable the ignore parameter with your relative file path.

 <ignore>/modules/module1/uploader.php</ignore> 

Just run the phpdoc command in the project root directory with the phpdoc.xml configuration file.

+2
source

All Articles