-
Notifications
You must be signed in to change notification settings - Fork 5
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
consider whether the library is already loaded before trying to use the bundled version #17
Comments
@yorkshire-pudding I see you have previous commits on this module -- are you interested in testing this one? Even if you don't test loading the library with Composer, I think testing with or without XAutoload would be good. |
I've tested this PR with Composer Manager installed and that seems to work nicely. |
Issue #17: Allow library via XAutoload+bundled OR Composer OR bundled.
I merged the PR since it sounded like a good idea, but now that I've been using the module for a bit I'm having some trouble. Reopening the issue because calling I'm actually encountering all sorts of problems already, just trying to do a requirements check for the status report, so I'm going to rework this to pull out the @quicksketch recommends using
By bundling the library with the module, we wouldn't be using Xautoload (or libraries) anymore at all, since the module will load the library on its own. |
@jenlampton That makes a lot of sense regarding |
Another thought: class_exists has a second parameter that defaults to true, to autoload the class in question. We could simply set that to false if this function was used inside hook_autoload_info? |
My preference is not to have varrying results from hook_autoload_info(), but if you can think of a way to do it in hook_autoload_info_alter() I'd be open to that. |
@jenlampton I'm testing locally with the
If you still strongly prefer the other, I'll try to implement it in |
I'd like to make this module maximally flexible for how people want to provide the library -- right now it bundles the library and has a hard requirement on XAutoload. On a few other modules I've begun to provide flexibility by considering whether the library is already loaded by some other method before trying to use the bundled version of the library. This makes XAutoload a soft requirement. Would you be open to something like that? Here's a PR that's near completion for another module as an example of what I mean:
The text was updated successfully, but these errors were encountered: