I have a serious problem with
phpDocumentor in a
WampServer based development environment on
Windows 10 Pro. The code I developed contains the phpDoc blocks needed to produce the documentation. To do this I used a
Visual Studio Code plugin. Now, however, I have to generate the documentation because I am producing a site for another person.
Below I report all the actions I have done in detail, so that you can reproduce the problem if necessary. In the end, I clarify what the problem actually is.
What I have tried:
Environment
Windows 10 Professional Intl. ENG vers. 21H1
WampServer 3.2.7
PHP 7.4.9
Installation
a. I downloaded the latest phpDocumentor.phar and saved it in C:\PhpTools\bin
b. I created a phpdoc.cmd executable script and saved in C:\PhpTools:
@php C:\PhpTools\vendor\bin\phpDocumentor.phar %*
c. I added C:\PhpTools to PATH System Environment Variable
d. I ran phpdoc --help on another folder to check if it works.
It works!
Steps to reproduce the problem
1. I moved to D:\#MyProject
2. I created D:\#MyProject\docs for documentation and D:\#MyProject\cache for cache
3. Source files are in D:\#MyProject\src
4. I created phpdoc.xml as follows
<?xml version="1.0" encoding="UTF-8" ?>
<phpdocumentor
configVersion="3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://www.phpdoc.org"
xsi:noNamespaceSchemaLocation="https://docs.phpdoc.org/latest/phpdoc.xsd"
>
<title>Kleo-IDP</title>
<paths>
<output>./docs</output>
<cache>./cache</cache>
</paths>
<version number="0.1.0">
<api>
<source dsn=".">
<path>./src</path>
</source>
<output>./docs</output>
<extensions>
<extension>php</extension>
</extensions>
</api>
</version>
</phpdocumentor>
5. I launched phpdoc from D:\MyProject
6. I got
phpDocumentor v3.3.1
Parsing files
59/59 [============================] 100%
Applying transformations (can take a while)
21/21 [============================] 100%
All done in 1 seconds!
phpDocumentor creates a .phpdoc folder in my folder project containing a cache subfolder, but it DOES NOT GENERATE any documention in docs. I also tried to execute the command without the configuration file, requesting a verbose output to check for troubleshooting:
phpdoc -t docs -d src --log=phpdoc.log -vvv --force
I get a lot of info, but no error. It looks like everything is fine, the code is parsed, the blocks are found, no log is created. In fact, I get
In the ProjectDescriptor are:
59 files
0 top-level namespaces
0 unresolvable parent classes
5 phpDocumentor\Descriptor\ClassDescriptor elements
27 phpDocumentor\Descriptor\MethodDescriptor elements
7 phpDocumentor\Descriptor\PropertyDescriptor elements
71 phpDocumentor\Descriptor\ConstantDescriptor elements
77 phpDocumentor\Descriptor\FunctionDescriptor elements
1 phpDocumentor\Descriptor\NamespaceDescriptor elements
but, again, no documentation is generated. I really have no idea of what I can do now.