New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php documentor version 3 is not using configuration file #2018
Comments
I don't know if it is related but also defining these configurations as command line argument does not bring the expected result: it parses the correct folder and then just outputs nothing with the information: $ phpDocumentor.phar run -d src/ -t docs --template "docs/_reference" --force
...
08:14:38 INFO [app]
Applying 0 transformations [] []
08:14:38 INFO [app] Finished transformation process [] [] Also the debug mode ( |
I am currently working on a story to rework the way configuration works. Part of that is to make sure that all elements of it function. In short, my current hypothesis is that this has to do with how phar works. phpDocumentor tries to retrieve the file from within the phar archive instead of outside of it. Unfortunately, that is a hypothesis and I hope to have more information soon |
I have just pushed changes to re-enable the use of an external configuration file. This is on develop and has no phar as of yet. |
I'm just trying it. The first problem: it expects a phpdocumentor root element in the xml file:
|
It seems to read the config file now but I don't know what to expect from this development version. Currently I get this error: $ env APP_ENV=dev /tmp/phpDocumentor2/bin/phpdoc project:run -c phpdoc.xml -vvv
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+47,104 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 46.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+2,048 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 48.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 50.00 megabytes (+2,048 kilobytes) [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 50.00 megabytes (+0 kilobytes) [] []
[2018-09-25 06:36:25] app.INFO: Starting to parse file: src/EntityManager.php [] []
[2018-09-25 06:36:25] app.INFO: Parsing src/EntityManager.php [] []
[2018-09-25 06:36:25] app.ALERT: Unable to parse file "src/EntityManager.php", an error was detected: "\ORM\EntityManager[string]" is not a valid Fqsen. [] []
[2018-09-25 06:36:25] app.DEBUG: >> Memory after processing of file: 52.00 megabytes (+2,048 kilobytes) [] []
In Project.php line 81:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Argument 1 passed to phpDocumentor\Reflection\Php\Project::addFile() must be an instance of phpDocumentor\Reflection\Php\File, null given, called in /tmp/phpDocumentor2/vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/Php/ProjectFactory.php on line 79
Exception trace:
phpDocumentor\Reflection\Php\Project->addFile() at /tmp/phpDocumentor2/vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/Php/ProjectFactory.php:79
phpDocumentor\Reflection\Php\ProjectFactory->create() at /tmp/phpDocumentor2/src/phpDocumentor/Parser/Parser.php:276
phpDocumentor\Parser\Parser->parse() at /tmp/phpDocumentor2/var/cache/dev/Container5ZQxJf3/Parser_37328e3.php:170
Parser_37328e3->parse() at /tmp/phpDocumentor2/src/phpDocumentor/Application/Stage/Parser.php:165
phpDocumentor\Application\Stage\Parser->__invoke() at n/a:n/a
call_user_func() at /tmp/phpDocumentor2/vendor/league/pipeline/src/FingersCrossedProcessor.php:16
League\Pipeline\FingersCrossedProcessor->process() at /tmp/phpDocumentor2/vendor/league/pipeline/src/Pipeline.php:59
League\Pipeline\Pipeline->process() at /tmp/phpDocumentor2/vendor/league/pipeline/src/Pipeline.php:67
League\Pipeline\Pipeline->__invoke() at n/a:n/a
call_user_func() at /tmp/phpDocumentor2/vendor/league/pipeline/src/FingersCrossedProcessor.php:16
League\Pipeline\FingersCrossedProcessor->process() at /tmp/phpDocumentor2/vendor/league/pipeline/src/Pipeline.php:59
League\Pipeline\Pipeline->process() at /tmp/phpDocumentor2/vendor/league/pipeline/src/Pipeline.php:67
League\Pipeline\Pipeline->__invoke() at /tmp/phpDocumentor2/src/phpDocumentor/Application/Console/Command/Project/RunCommand.php:249
phpDocumentor\Application\Console\Command\Project\RunCommand->execute() at /tmp/phpDocumentor2/vendor/symfony/console/Command/Command.php:251
Symfony\Component\Console\Command\Command->run() at /tmp/phpDocumentor2/vendor/symfony/console/Application.php:904
Symfony\Component\Console\Application->doRunCommand() at /tmp/phpDocumentor2/vendor/symfony/framework-bundle/Console/Application.php:89
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /tmp/phpDocumentor2/vendor/symfony/console/Application.php:262
Symfony\Component\Console\Application->doRun() at /tmp/phpDocumentor2/vendor/symfony/framework-bundle/Console/Application.php:75
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /tmp/phpDocumentor2/vendor/symfony/console/Application.php:145
Symfony\Component\Console\Application->run() at /tmp/phpDocumentor2/bin/phpdoc:44 |
Thanks for this feedback @tflori. We fixed the second reported issue. |
Sorry for my english... this issue fixed at Release v3.0.0-alpha.3 or not? it still dont use correct target directory from the file. (but the flag -t is working correctly) |
I can't figure out how use an external configuration file with the phar file from version 3.0.0-alpha3. Can anyone help me in the right direction? |
The current phar is not working correctly. We need to create a new release to provide a new phar. You could try the install latest version from the develop branch. Using composer. |
I tried it but I get conflicts with composer packages that require newer versions of certain packages.
Installing these packages gives the following composer log:
Is there a way to get around this problem? |
The only thing I can think of is installing phpdocumentor in a separate directory. We do not recommend installing phpdocumentor in a project because of the number of conflicts you encounter and others did in the past |
Okay, did what you suggested. I ran the command:
It did say it used the provided configuration file. But no files are created anywhere.
And this is my xml file which is at the root of the project I want to generate documentation for <?xml version="1.0" encoding="UTF-8" ?>
<phpdocumentor>
<parser>
<target>docs</target>
</parser>
<transformer>
<target>docs</target>
</transformer>
<files>
<directory>src</directory>
<ignore>src/Kernel.php</ignore>
<ignore>src/Migrations/*</ignore>
<ignore>src/Repository/*</ignore>
</files>
<title>SEAD Documentation</title>
</phpdocumentor> Do I have to place the configuration file somewhere else and/or change the paths of the files, transformer and parser section of the configuration? |
The source path is relative to the director where you start phpdocumentor. With this configuration you should be in the directory sead, I expect that to be the root of your project 😄 |
That is indeed the root of my project. Thank you sir, it worked. I thought the source paths where relative to the configuration file. I read that somewhere in the documentation on docs.php.org. |
I am glad to hear that it worked for you. Thanks for having us. And that you took your time to create an issue. |
Expected Behavior
I have a configuration file that defines another target for the parser, another target for the transformer and a template. I expect that it still works or at least the documentation says how to configure this now and what needs to be changed for version 3.
Actual Behavior
It renders the default template to the default path which is useless for me.
Steps to Reproduce the Problem
-c <path-to-config.xml>
Your environment
The text was updated successfully, but these errors were encountered: