Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Notice: Use of undefined constant DEBUG_BACKTRACE_IGNORE_ARGS - assumed 'DEBUG_BACKTRACE_IGNORE_ARGS' in Drupal\xautoload\Libraries\LibrariesFinderPlugin->findFile() (line 53 of /xautoload/src/Libraries/LibrariesFinderPlugin.php).
This issue is related to PHP 5.3.3
Was fixed here for render_cache:
#2177227: Warning: debug_backtrace() expects at most 1 parameter with php < 5.4
Comment | File | Size | Author |
---|---|---|---|
#5 | use_of_undefined-2365781-2.patch | 1.44 KB | joelpittet |
Comments
Comment #1
donquixote CreditAttribution: donquixote commentedWould this work?
Btw, I would prefer if this libraries stuff lived in an optional submodule. Now I have to support this in the main module for BC.
Comment #3
donquixote CreditAttribution: donquixote commentedFixed in 7.x-5.x.
Comment #4
donquixote CreditAttribution: donquixote commentedComment #5
joelpittetHuh, I'm only using
Which I love btw!
I'm guessing your saying that libraries stuff loads anyways?
I'm sorry I still have a 5.3 server:( Here's a patch fixing both instances of that constant, I tested it out and it fixes things, thanks.
Comment #6
joelpittetOh you're too fast, I cross-posted. Want to cherry pick the other one out?
Comment #7
donquixote CreditAttribution: donquixote commentedThis is a more complicated story.
See #2297525: Libraries integration: Require libraries_load()..
Libraries API by itself is designed in a way that you need to call libraries_load() before anything from the library becomes available.
E.g. files being included.
xautoload libraries support, however, is designed so that the classes / namespaces are available on every request, without any libraries_load(). This might have been a bad decision, but now I support this for BC. Also it seems that most people really want this.
To make the libraries autoload stuff available, we need to get the closure from hook_libraries_info(). However we don't want to call module_invoke_all('libraries') on every request. And caching is difficult because closures cannot be serialized.
So the solution is:
- xautoload_libraries_info_alter() cleans out the closures from hook_libraries_info() data, and replaces them with SerializableClosureWrapper.
- On a request where the APC / APCu / whatever classmap cache is hot, we don't do any of this.
- If the classmap cache has a miss (which also happens if a class is forwarded to another autoloader), we retrieve the xautoload stuff from hook_libraries_info(), and execute the closures. This info is cached, using SerializableClosureWrapper.
Wicked, isn't it?
This works surprisingly well, but it makes the module look intimidating. Would really be better if this was in a submodule.
Comment #8
donquixote CreditAttribution: donquixote commentedI already pushed to drupal.org.
I think this code is never executed if the module is used correctly.
And for the case that it is, I wonder if the debug_print_backtrace() is really a good idea. It looks to me like a leftover from debugging.
The exception should be good enough.
Comment #9
joelpittet@donquixote I like your story:) And agree a submodule be preferable to keep it light on it's feet though BC breaking could be tricky. Something to add to a 7.x-6.x roadmap perhaps?
Just thought I'd be thorough as that same constant was there, but I've not run into that DrupalSystem error so not too concerned.
Comment #11
donquixote CreditAttribution: donquixote commentedToo bad I missed to add you in the commit message.
You get some "fake credit" in exchange :)
http://cgit.drupalcode.org/xautoload/commit/?h=7.x-5.x&id=80f05502177572...
Comment #12
donquixote CreditAttribution: donquixote commentedActually it is even more fancy :)
Comment #13
joelpittetI'll take it:) Thanks and very cool strategy