Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

Shell
@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

Shell
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:

Shell
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

Shell
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.
Posted
Updated 5-Jul-22 11:27am
v2

1 solution

I found the cause of that bug. It is related to the fact that the path contains a has character, that is #MyProject. phpDocumentor change it to %23MyProjects and then create the %23MyProject folder in the filing system.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900