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

Confusing warning "phpDocumentor supports 1 set of API documentation at the moment" #3493

Closed
tadhgboyle opened this issue Mar 24, 2023 · 4 comments

Comments

@tadhgboyle
Copy link

Seems to be added here: #3477, but without specifics about what exactly will cause this.

I have tried to go through the code and see what causes this exact error, but I can't identify anything.

We are running PHPDocumentor from a Dockerfile, with no extra config and it has been working perfectly until last week:

FROM phpdoc/phpdoc as doc_builder

COPY . /source

RUN mkdir /target && \
    phpdoc -d /source/core/classes \
        -d /source/modules/Core/classes \
        -d "/source/modules/Discord Integration/classes" \
        -d "/source/modules/Cookie Consent/classes" \
        -d /source/modules/Forum/classes \
        -d /source/modules/Members/classes -t /target -i /vendor

FROM nginxinc/nginx-unprivileged:stable

COPY --from=doc_builder /target /usr/share/nginx/html

What are we doing wrong?

@phpdoc-bot phpdoc-bot added this to Needs triage in phpDoc issue triage board Mar 24, 2023
@mvriel
Copy link
Member

mvriel commented Mar 24, 2023

That is a really good question! When you use the command-line like you did, it should create a single set of API Documentation with these settings.

It sounds like there is a bug there, though it probably also meant that you might have been missing some pieces of doc because this error only describes the existing assumptions in the application.. unless the error itself has a bug..

I'll check it out

@mvriel mvriel self-assigned this Mar 24, 2023
@mvriel
Copy link
Member

mvriel commented Mar 24, 2023

I think I found the cause, but I need to verify this in the code yet.

If I remember correctly, there is a slight assumption in phpDocumentor that when you pass absolute paths as source directories, then it will assume they are not part of the same project and thus must be multiple individual Documentation Sets.

I had trouble reproducing your situation until I started using absolute paths like this:

FROM phpdoc/phpdoc as doc_builder

COPY . /source

RUN mkdir /target && \
	phpdoc -d /source/src \
		-d /source/vendor/phpdocumentor \
    	-i /source/vendor/phpdocumentor/flyfinder \
    	-t build/3493

FROM nginxinc/nginx-unprivileged:stable

COPY --from=doc_builder /target /usr/share/nginx/html

If I change that to

FROM phpdoc/phpdoc as doc_builder

COPY . /source

WORKDIR /source

RUN mkdir /target && \
	phpdoc -d src \
		-d vendor/phpdocumentor \
    	-i vendor/phpdocumentor/flyfinder \
    	-t build/3493

FROM nginxinc/nginx-unprivileged:stable

COPY --from=doc_builder /target /usr/share/nginx/html

The issue does not occur.

As such, I recommend using relative paths or a configuration file. What I can do in the mean time is to change the error message and/or documentation to make this clear

@mvriel
Copy link
Member

mvriel commented Mar 24, 2023

I have just updated the error message with why the error occurs and how it can be resolved: e59fc6e

I apologize for the inconvenience, it would have been handy if we had added this message when we started with the effort to support multiple documentation sets

@mvriel mvriel closed this as completed Mar 24, 2023
phpDoc issue triage board automation moved this from Needs triage to Closed Mar 24, 2023
@tadhgboyle
Copy link
Author

Thank you so much 😊

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

No branches or pull requests

2 participants