Hi all -- so, great to see a handful of install profiles start showing up.
One thing I noticed today with the new "Drupal for Churches" (see the full list of install profiles here: http://cvs.drupal.org/viewcvs/drupal/contributions/profiles/) is that Mike P included the helper file "crud.inc".
This is a file that we put together that bundles simple functions for working with data structures in Drupal and configuring them "out of the box" for install profiles (fyi -- CRUD == Create / Read / Update / Delete).
See https://svn.bryght.com/dev/browser/bryghtbase/DRUPAL-5/trunk/html/profiles for the latest version. Which brings me to my point :P
We need to, I think, have this file somewhere central where we can work on it together...the version I pointed to is already updated from what Mike P checked in. I've talked to the CVS maintainers to see what the best place is...I may just check in basic.profile as well as an example, and of course we need to get started with DrupalEd as another candidate.
I think Mike P and I are the only ones using this type of crud.inc so far, but right now I'm looking to see at a) how we can pull out config from Drupal core and move it to default.profile as well as b) how to get more of these functions in core rathering than having to do somewhat hack~ish database updates.
Comments
Core efforts at CRUD
Creating a library of CRUD API functions for Drupal - mostly discussion about best practices.
General _load, _save, and _delete methods for all objects, plus a single object hook - has an actual patch.
Simplify hook_user() and user_save(), etc. to be more consistent with other object methods - efforts to simplify hook_user, etc. as they are a major barrier to the general _load, _save, etc. patch.
As far as where to put stuff like this... maybe a "Profile Helpers" profile which is just a collection of .incs, .modules, etc. that simplify or make the process of making profiles easier... it could be setup like:
/profiles/_profile_helpers/crud_inc/crud.inc
/profiles/_profile_helpers/crud_inc/README.txt
/profiles/_profile_helpers/wizard/wizard.module
/profiles/_profile_helpers/wizard/wizard.info
/profiles/_profile_helpers/wizard/README.txt
(there currently is no 'wizard' module to my knowledge, but it's only a matter of time before someone develops a generic means of injecting forms after the db setup process... I think it's one of our SoC proposals)
I "think" that CVS access can be doled out on a per-directory basis, so you could still have maintainers of individual projects and everyone else working through the issue queue. Someone would need to check with Derek/dww about that to be sure.
Re: crud for install helpers
I think you might just want to consider calling it install profile helpers or something like that. While it's true this all will be much easier when CRUD is in core, this still seems to go a little bit beyond what basic crud functionality would include.
BTW, Wizard module does exist. http://drupal.org/project/wizard
And it looks like the SoC project of the same name is to work on that project. I've begun some work on a module that would provide the functionality to walk the user through a set of system config forms. I hope to be able to commit something shortly.
CVS implications
that's all the news for now. wish i had a nicer story to offer, but at this point, things are still rather primitive. problem is, it'll be a lot of work to figure out how all the packaging stuff should work, and then yet more work to actually make it happen. i have no time for this right now, and unless someone wants to offer me a nice pile of cash, it's probably not going to be able to happen very soon. i hope to at least make some progress on the design debate at OSCMS next week...
Project or Install Profile?
OK, thanks for the lengthy feedback DWW, much appreciated as always.
I suspect I will create either a Project or an Install Profile to keep that master file available on d.o. I'm leaning towards a project right now.
BTW -- it seems the ACLs aren't working, because crud.inc is included in DFC / Drupal for Churches....
ACL weirdness
yeah, that's nuts. profiles/development even includes (forks of, EVIL!!) generate-content.php and generate-users.php from the devel module. argh. i'll look into this right away.
use of "project" is confusing...
huh? ;) install profiles, modules, themes, theme engines, and translations are all represented by project nodes on d.o. so, i don't understand what "create either a project or an install profile" means. maybe you meant:
"i suspect i will create a project as either a module or an install profile to keep that master file available on d.o ... i'm leaning towards a module right now."
right? if that's the case, i'd probably call it something like "install_profile_api", since that's what it's going to be -- a library of programmer interfaces to make writing install profiles easier, no?
cheers,
-derek
Sorry...
I meant a module project.
nice
good stuff ... except what it does is not what I would call CRUD. i guess that happens over time.
lullabot developed a similar "profile helpers" module. we must unite for D6
Why do you say it doesn't do
Why do you say it doesn't do CRUD? It creates, reads, and updates values in the Drupal DB.
Yep, check Angie's list of such things in core. Lots of refactoring to be done for D6. I posted elsewhere, and Dries has confirmed, that he would like to see a collection of install profiles available in core for D6, so that's probably the best place to focus.
Profile helpers module? Is it in CVS? Can I join / co maintain to stick crud.inc in there?
Committed Install Profile API
OK, I committed the Install Profile API -- http://drupal.org/project/install_profile_api
Please ping me if you want to co-maintain. Ideally, anyone working on install profiles will join us, and we'll work on pinpointing functions that should move to core.
Thank you -
Very nice work. I'm a happy user of crud.inc now.
The sad thing is it's missing a sibling: every create function should have an export function as a counterpart that can export the data structure in a compatible format.
$something = array(array('really complicated'));
$export = export_something();
install_something($export);
// $something = array(array('really complicated'));
So many bits and pieces are there:
many are easy to do
and then: why not content export/import functions too ;P ?
http://www.twitter.com/lxbarth