Closed (fixed)
Project:
Update API
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2009 at 17:44 UTC
Updated:
25 Dec 2009 at 16:10 UTC
How do you include the functions in an update_N hook?
Comments
Comment #1
q0rban commentedHmm, this probably is a bit confusing, isn't it?
Since this is most often used in conjunction with a wrapper module that is implementing the API, I have it inside that module's directory and then use module_load_include().
I think it would make sense to have a module file though, so you could just run a function to include the needed files. What do you think?
Comment #2
mrfelton commentedYes, Im using the functions from within several modules update hooks, so ideally I need to just be able to load it using module_load_include(). I guess you jkust need to create a .info and a .module file for that to work?
Better still... consider integrating with install_profile_api. I like your functions, and I like the ones in install_profile_api - I use both, but I can't see the need for both projects to exists. They should be combined. Install profile API already has a good wrapper function for including required functions.
Comment #3
q0rban commented> Install profile API already has a good wrapper function for including required functions.
I'd rather do something similar to ctools where you just call something like
update_api_include('user');and you get all the functions for users. I'll think about it some more. If you have any ideas, certainly let me know. :)> Better still... consider integrating with install_profile_api.
I'm totally down with merging, I just haven't gotten any response on #498616: Merge update_api and install_profile_api. I don't really expect a response any time soon, as most of the maintainers are probably working on D7.
Comment #4
mrfelton commented> I'd rather do something similar to ctools where you just call something like update_api_include('user'); and you get all the functions for users. I'll think about it some more. If you have any ideas, certainly let me know. :)
That is basically how the install_profile_api() wrapper works... You simply call:
you pass the names of any supported modules that you want the functions from.
I don't know much about ctools (yet) but the method sounds similar from what you described...
Comment #5
q0rban commentedThanks, fixed! http://drupal.org/cvs?commit=300784