Reworks ffi enablement documentation & adds context to exception#285
Open
nfreader wants to merge 1 commit intolibvips:masterfrom
Open
Reworks ffi enablement documentation & adds context to exception#285nfreader wants to merge 1 commit intolibvips:masterfrom
nfreader wants to merge 1 commit intolibvips:masterfrom
Conversation
…or message as well
jcupitt
reviewed
Dec 28, 2025
| } | ||
| $msg .= ". Make sure that you've installed libvips and that '$vips_libname'"; | ||
| $msg .= " is on your system's library search path."; | ||
| if ('preload' === ini_get('ffi.enable')) { |
Member
There was a problem hiding this comment.
How about moving this up a bit? On line 284 we have:
if (!ini_get('ffi.enable')) {
throw new Exception("ffi.enable not set to 'true'");
}We could change that to:
if (!ini_get('ffi.enable') ||
ini_get('ffi.enable') === 'preload') {
throw new Exception("ffi.enable not set to 'true'");
}I think (I think??) we need both tests.
Author
There was a problem hiding this comment.
That’s probably a better place for it, I just worry about unintended consequences. I don’t know enough about FFI to fully grasp what this might mean later on down the line.
Member
|
Ahh how annoying, I'm sorry that bit you. Yes, happy to accept this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
I ran into an issue where I assumed ffi was properly enabled; it was not and I spent many hours trying to debug the problem. This PR reworks the section of the readme that talks about enabling FFI. I've also added an
ini_getcheck in the FFI class that handles loading libraries. Right now it just appends to the message thrown by the exception, but it might work better as its own exception.