Skip to content

Conversation

@lacatoire
Copy link
Contributor

Description

This PR adds a simple Docker Compose workflow to build and preview the PHP manual locally.
It provides a lightweight, cross-platform alternative to the existing make setup and works on Linux, macOS, and Windows (including PowerShell).

The goal is to make contributing to the documentation easier for new and existing contributors by removing installation steps and dependency issues.

Highlights

  • Uses PhD inside a clean Docker environment
  • Default language is English (en), but others can be built easily:
    • Linux/macOS: LANGUAGE=fr docker compose up --build
    • PowerShell: $env:LANGUAGE="fr"; docker compose up --build
  • Output format (e.g. xhtml, php-chunked-xhtml) can be changed in the compose.yaml file
  • Automatically handles CRLF normalization on Windows

Technical notes

  • Based on php:8.2-cli-alpine for stability and minimal dependencies.
  • PHP 8.3 and 8.4 were skipped to avoid compatibility issues with the PhD toolchain.
  • FrankenPHP was considered for serving the output but would add unnecessary complexity the built-in PHP server is enough here.

Does not modify the existing make build process this is an optional, self-contained alternative.

Impact

This setup should lower the barrier to entry for contributors and make it easier to test translations and improvements locally, without manual setup.

@Girgias Girgias requested a review from afilina November 4, 2025 06:04
Copy link
Contributor

@afilina afilina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this workflow a lot. Merci!

I followed the instructions for default and fr on both Linux and PowerShell. Everything behaves as expected. I left some usability and other suggestions in the review comments.

Future improvement ideas (I can open issues once this is merged, and we can have discussions about each item at that time):

  • Ask whether the user wants to clone missing dependencies.
  • Remove the previous docker-based workflow.

Copy link
Contributor

@afilina afilina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for incorporating the suggestions. Just the directory check that doesn't seem to behave as expected. See details in the comment.

Copy link
Contributor

@afilina afilina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still says "doc-fr is missing or incomplete!" even after I clone it. Please test the full workflow (starting at missing doc-fr and doc-base) before submitting for review again. This will allow you to catch and fix errors early.

Also if you could add changes as a separate commit for each review iteration, as squashing means I have to re-read everything each time, and I've done this multiple times already. Thanks.

@lacatoire
Copy link
Contributor Author

Thanks again for the review @afilina
After giving it some thought, I decided to remove the extra dependency-checking logic I had added earlier, so this PR stays focused on the original, simple idea. I think your suggestion makes perfect sense, improvements like optional dependency cloning or revisiting the previous Docker workflow can be explored later in a separate PR or dedicated issues.
Once this is merged, I’d also be happy to look into updating the PHP version used for the build (8.3 or 8.4), if that would be helpful.
Thanks again for your time and guidance, it’s truly appreciated!

@lacatoire lacatoire requested a review from afilina November 24, 2025 19:16
@afilina
Copy link
Contributor

afilina commented Nov 25, 2025

I'm on my way to a conference overseas, so I won't be able to give it another review until Sunday.

Copy link
Contributor

@afilina afilina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lacatoire Looks like the last change went to the other extreme and we're now back to "Could not open input file: configure.php". Newcomers will not always connect this error message to the skipped step in the docs, and will open issues, which the documentation team will need to address.

I feel like you were really close. You just need to check the right files at the correct time, with an error message guiding towards the solution, and then test both the happy path and the "missing repos" path.

@lacatoire
Copy link
Contributor Author

Thanks! I’ve updated the script to detect the correct language directory and to check a stable file. This keeps the workflow simple while giving clear guidance if a repo is missing. Let me know if anything else looks off!

@lacatoire lacatoire requested a review from afilina December 2, 2025 10:52
@afilina
Copy link
Contributor

afilina commented Dec 3, 2025

Thanks for resolving the missing folder checks. There seems to be a regression in the main functionality. When running without LANGUAGE, everything is fine, But when running for fr, the console shows:

phpdoc-builder | Creating file-entities.ent... Language directory not found: /var/www/en
phpdoc-builder | .doc-base/scripts/file-entities.php FAILED.

And the URL says "The requested resource / was not found on this server."

A bit higher up, there were other errors in the console that might be relevant:

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/doc-base/configure.php on line 590
fatal: cannot change to '/var/www/en': No such file or directory

Please ensure the PR is fully tested after the next fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants