Closed (fixed)
Project:
Libraries API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Oct 2011 at 19:52 UTC
Updated:
19 Nov 2011 at 09:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
robloachExample from Symfony...
With the patch applied, since the PHP files are loaded before the invoke is made, we can use the ClassLoader.
Comment #2
tstoecklerHmm... that makes sense. We actually want both, though. We don't do that yet, but a use-case for a 'pre-load' callback is turning filepaths like "jquery-[version]-min.js" into the proper names so they can be loaded. So this is actually a feature request, however a very valid one.
Comment #3
robloach"pre-load" and "post-load" maybe?
Comment #5
robloachMaybe "load" and "loaded"?
Comment #6
tstoecklerThat should probably come first.
That's not really correct. 'loaded' currently counts the number of loaded files, so
if ($library['loaded']) {}<\code> works, but it's not really a flag. Maybe we can just leave out the comment. :)This looks really good already. We need to update the hook_libraries_info() documentation, though, and we need some tests for this. The callbacks are already tested in general so we just need to adapt the existing tests.
Comment #7
tstoeckler"pre-load" and "post-load" is seld-documenting and is inline with "pre-detect" and "post-detect", so let's go with that.
Comment #8
robloachSounds good... I fixed up the tests.
Comment #9
tstoecklerThanks very much for the patch. That was exactly what I was looking for. Below are some nitpicks, but they are really minor. And the tests show that this works as expected. I'll commit this in the next few days, and unless you want to roll another patch (which would be even more awesome) I'll fix the stuff below pre-commit.
To be more inline with the other groups, that should be something like: "At this point the library contains a 'loaded' key, which contains the number of files that were loaded."
And below: Library -> library.
And below: That should be "Pre-load and post-load callbacks ..."
Comment #10
robloachComment #11
tstoecklerThanks for the reroll. Below are some very minor nitpicks. I'm still marking RTBC, though, because (unless you'd like to re-roll again, which would be awesome, of course), I'd happily fix that prior to commit. If I weren't so terribly tired right now, I'd go ahead and commit it right now. I hope to get to that beginning of next week, though.
"loaded" -> 'loaded', also I think the first line wraps early.
"... only the pre-load AND POST-LOAD callback groupS ..."
Comment #12
tstoecklerI did some minor documentation fixes pre-commit, and then committed this. Patch is attached.
Thanks again!
http://drupal.org/commitlog/commit/10030/3db1b3ed803d00a4633096fa43faafb...