-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix PDF generation #69
base: master
Are you sure you want to change the base?
Conversation
Implicit conversion to array is no longer supporter when appending a value to an empty string.
Using curly braces for such purpose is no longer supported in PHP 8.
The original haru extension is currently unmaintained and no longer supported. This patch adds a minimal libharu intarface through FFI with only the bindings needed to generate the PHP documentation.
Now the haru bindings are embedded in phd, there is no need to ckeck for the haru extension presence.
Implicit casting of the operands has been deprecated.
We use BSD 2-Clause to match the license of the other sub-packages in this repository and to allow the possibility of extracting this package into a standalone package in the future.
Thank you. But do we really need this? What do we use PDF generation for? |
@athos-ribeiro, have you been able to generate the docs as PDF? If so, could you please upload this for inspection? I assume that a lot of "details" are not properly supported, and we should try to assess the required total cost of reviving PDF support. |
Thanks for the feedback, Kamil and Christoph.
This is a first step to fix unsupported/broken code. While the PHP doc group does not officially use the code for any documentation releasing purposes, a user could possibly come across these code snippets and try to build PDF docs for some reason, since the option is available. I understand how adding a new package to handle that may be seen as "bloating the repository" to handle unsupported code. We could instead create the Haru FFI package as an external dependency for one willing to build PDF docs. This would reduce this patch set to a few lines fixing support to php 7 and using the external package instead of the haru ext.
FWIW, the current PDF related code doesn't meet the requirement versions either, since it requires PHP <= 5 AFAICT. With this changes, we would need PHP >= 7.4, which would only exclude 7.1 and 7.2 from the CI matrix (which is an improvement). We should also add a PHP version check if we are to proceed with this though.
Yes, I could generate the docs. Still, as you mentioned, there are a few details to be worked on,keeping in mind that the PDF codebase has not been maintained for a while, so the PDF files presentation would need some working as well. Still, we can generate readable files for most of these docs. Instead of uploading the output somewhere, I wrote this small shell script that would allow generating the output from a docker build. Is this enough for you to check the files? The benefit here would be to see the whole build process going on and spot the warnings and errors we still get with the build. If not, I can upload the pdf files somewhere.
|
On an attempt to revive the PHP PDF documentation, I filed php/phd#69. The Pull Request above proposes substituting the now unmaintained libharu PECL extension with a minimal libharu FFI package which is compatible with the PECL extension. We now start extracting the FFI package in case this is useful for other users.
This is a first step into fixing the PDF generation.
This is done by substituting the now unmaintained libharu extension with a minimal FFI pakcage.
There are still a few nits that need fixing in the new implementation, but this first patch set is enough to revive the pdf docs generation.
I am aware there was a discussion regarding removing the pdf support from this repository. In case there is no interest in re-generating pdf docs, we can just close this PR :)