Skip to content
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

DirectoryCleaner has problem with rmdir #402

Open
ogmueller opened this issue Aug 6, 2020 · 3 comments
Open

DirectoryCleaner has problem with rmdir #402

ogmueller opened this issue Aug 6, 2020 · 3 comments
Assignees
Labels

Comments

@ogmueller
Copy link

Somehow phpdox is not able to execute anymore since changing to PHP 7.4.x

PHP Version: 7.4.3 (Linux)
PHPDox Version: 0.12.0
ErrorException: E_WARNING
Location: phar:///usr/local/src/phive/phars/phpdox-0.12.0.phar/phpdox/shared/DirectoryCleaner.php (Line 32)

rmdir(/var/lib/jenkins/workspace/project/build/api/.): Invalid argument

No stacktrace available
@ogmueller
Copy link
Author

This configuration was working previously:

<build engine="html" enabled="true" output="./">
    <template dir="${phpDox.home}/templates/html"/>
    <file extension="xhtml"/>
</build>

but now is producing the warning described above.

Removing the dot and changing the path to "/" is doing the trick:

<build engine="html" enabled="true" output="/">

Though I think the above config should work and the output path "/" (root) feels uncomfortable.

@theseer
Copy link
Owner

theseer commented Aug 6, 2020

Apart from the fact that crashing is obviously the wrong way to deal with a problem - and an interesting bug with regards to a different PHP version I do not yet understand -, I'm not sure I understand the configuration value itself.

Why would you use ./ as the output path instead of an actually named directory, potentially relative to the configuration file? And what's the expected difference to .?

And, lastly, why would / work? Unless you run as rootyou shouldn't even have write permissions to/`, let alone want to have it cleaned...?

@theseer theseer self-assigned this Aug 6, 2020
@theseer theseer added the Bug label Aug 6, 2020
@ogmueller
Copy link
Author

I am not certain how this config has been created, but as far as I experienced, the output path is relative to the generator path. So a "/" is not root, even though it feels like it is, but rather the generator path itself, which was the goal in the first place, I assume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants