Phpdocumentor: Nothing parsed - still says everything is ok

Created on 28 May 2018  Â·  11Comments  Â·  Source: phpDocumentor/phpDocumentor

When I run phpdoc from the phar with a custom config xml* or source & target, it runs through (very quickly) but it doesn’t create any doc files except the index.html and the doc template resources.

_* custom config is named "codedocu.xml" and it's xml structure is positively validated_

  • v3.0.0-alpha1
  • php 7.2.1

It also doesn’t create nor write anything to the given log path.

It does however say that it found the source folder... so I assume it’s not simply because a wrong path is given.

Any clues where and how I can debug this?
I already tried setting logging level to "debug" and to run it using --verbose…

Collecting files .. OK
Initializing parser .. OK
Parsing files
Storing cache in "/output/build" .. OK
Load cache                                                         ..    0.000s
Preparing template "clean"                                         ..    0.006s
Preparing 17 transformations                                       ..    0.000s
Build "elements" index                                             ..    0.000s
Replace textual FQCNs with object aliases                          ..    0.000s
Resolve @link and @see tags in descriptions                        ..    0.000s
Enriches inline example tags with their sources                    ..    0.000s
Build "packages" index                                             ..    0.000s
Adding Parents to child interfaces                                 ..    0.000s
Collect all markers embedded in tags                               ..    0.000s
Build "namespaces" index and add namespaces to "elements"          ..    0.000s
Adding Parents to child classes                                    ..    0.000s
Transform analyzed project into artifacts                          .. 
Applying 17 transformations
  Initialize writer "phpDocumentor\Plugin\Core\Transformer\Writer\FileIo"
  Initialize writer "phpDocumentor\Plugin\Twig\Writer\Twig"
  Initialize writer "phpDocumentor\Plugin\Graphs\Writer\Graph"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "FileIo"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "twig"
  Execute transformation using writer "Graph"
   0.094s
Analyze results and write report to log                            ..    0.000s

When I look at the generated documentation folder, there is no "structure.xml" in there – which I read, should contain all the information (not sure).

bug

Most helpful comment

I found the bug for the directory issue. The pr is ready but I have to fix some failing tests before a new release.

All 11 comments

I have the same issue where use phpdoc3, and the php2.9 is ok.
phpdoc 3.0 beta
php version is PHP 7.1.7

Could be related or a duplicate to issue #1960

could you provide the content of you config file? Paths can be redacted when preferred. It could be that there is an issue with the new file finder which we missed.

@jaapio here you go:

codedocu.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
    <title>My Code Documentation</title>
    <parser>
        <target>/var/codedocu</target>
        <encoding>utf8</encoding>
        <default-package-name>MyProject</default-package-name>
        <markers>
            <item>TODO</item>
            <item>FIXME</item>
        </markers>
        <extensions>
            <extension>php</extension>
            <extension>js</extension>
        </extensions>
        <visibility></visibility>
    </parser>
    <transformer>
        <target>/var/codedocu</target>
    </transformer>
    <logging>
        <level>warn</level>
        <paths>
            <default>/var/log/phpdoc/{DATE}.log</default>
            <errors>/var/log/phpdoc/{DATE}.errors.log</errors>
        </paths>
    </logging>
    <transformations>
        <template name="clean" />
    </transformations>
    <files>
        <directory>/srv/www</directory>
        <file>somefile.php</file>
        <file>anotherfile.php</file>
        <ignore>allstats/*</ignore>
        <ignore>awstats/*</ignore>
        <ignore>downloads/*</ignore>
        <ignore>files/*</ignore>
        <ignore>frets_py/*</ignore>
        <ignore>gluv/*</ignore>
        <ignore>images/*</ignore>
        <ignore>img/*</ignore>
        <ignore>mt/*</ignore>
        <ignore>mobile/*</ignore>
        <ignore>smartylib*/</ignore>
        <ignore>test/*</ignore>
        <ignore>traffic/*</ignore>
        <ignore>date-format.js</ignore>
        <ignore>dropzone.js</ignore>
        <ignore>emoji*</ignore>
        <ignore>hightlight*</ignore>
        <ignore>jquery*</ignore>
        <ignore>quill*</ignore>
        <ignore>tribute*</ignore>
        <ignore>google*.html</ignore>
    </files>
</phpdoc>

Hello,
i met the same problem (i use the phar version with php7.2) and it seems that, phpdoc is completely ignoring the -d|--directory and also the <directory> <file> and <ignore> markups from the phpdoc.xml.
It just analyze the current directory recursively.
For instance, i have a directory structure like that:

  • app_root

    • tools



      • phpdoc


      • onefile.php



    • libs



      • mylib





        • otherfile.php





      • otherlib





        • otherfile2.php






If i call phpdoc from the tools directory (cd tools && phpdoc...), it will only parse onefile.php, if i call it from within libs directory (cd libs && ../tools/phpdoc...), it will parse otherfile.php and otherfile2.php and this with whatever value in the config file or in the cli arguments

I don know if i'm clear.
I hope this could help.

Btw, when it met all the file, the rendering is good (except for the --sourcecode directive which don't work with me)

I found the bug for the directory issue. The pr is ready but I have to fix some failing tests before a new release.

Awesome, thanks @jaapio! Hope this makes it into new .phar very soon

@jaapio any ETA when this Bugfix will be merged into a new (phar) Release of phpdocumentor?

@oliveratgithub we have some nightly builds available at the release page. I think those should solve the directory issue. however I discovered some other issue here when passing absolute paths with the -d flag. I think your configuration should just work.

Don't put quotes around the arguments...

No:
$ php ./phpDocumentor.phar "-d ./myproject -t ./codedocu"

Yes:
$ php ./phpDocumentor.phar -d ./myproject -t ./codedocu

If you need quotes around one value that has spaces in it, then:
$ php ./phpDocumentor.phar -d "./my project" -t "./code docu"

CRB

On Sat, Jul 21, 2018, 03:18 Oliver notifications@github.com wrote:

@jaapio https://github.com/jaapio I just tested with the newest nightly
build (v3.0.0-alpha.2-nightly-gdff5545

https://github.com/phpDocumentor/phpDocumentor2/releases/tag/v3.0.0-alpha.2-nightly-gdff5545)

  • but again, no luck. Nothing happens.

This is so frustrating... I mean, it's the very basic somehow to be able
to pass files that phpDoc should process - but it just does't do anything.
I'm already thinking I'm a complete idito doing it totally wrong :D

Is there something wrong when I'm running it like this from the CLI?
Approach No. 1 (pass -d):

$ cd /Users/me/Sites/ $ php ./phpDocumentor.phar "-d ./myproject -t
./codedocu"

Expectation: it should index all code from the dir
/Users/me/Sites/myproject => and the documentation should be found in the
dir /Users/me/Sites/myproject-docu
Approach No. 2 (use custom config):

$ cd /Users/me/Sites/ $ php ./phpDocumentor.phar "-c ./codedocu.xml"

Expectation: it should index all code from & output the doc to the dirs as
defined in the xml-config structure in codedocu.xml (see previous posts)

...it does not even create the Logfiles, so I don't know but it feels like
I'm doing something wrong fundamentally? Still I get the Terminal out... no
errors. Verbose is not working, Verify is not working...

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/phpDocumentor/phpDocumentor2/issues/1982#issuecomment-406780067,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGHSlgxPKpN5mPwHKa9FEOh5BEqihBfks5uIuPMgaJpZM4UPfIA
.

Closing this issue since it should have been resolved in alpha 3 release.

Was this page helpful?
0 / 5 - 0 ratings