In progress changes to Install Profile API for D6

Boris Mann's picture

I just committed a bunch of let's-see-if-this-works changes to install profile API for D6--1 (http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/install_pro...).

Changes:

  • removed crud.inc
  • beginnings of turning install_profile_api into a module -- only purpose here is so that install profiles can depend on it / require it
  • split crud.inc into one .inc file per module
  • tried to start doing some "smart loading" -- basically, an install profile is going to require a bunch of modules, which is in an array -- pass that same array to an install profile api function and it will "smart include" the required .inc files; ideally, it will look in contrib/.inc as well as modules//.install.inc -- the former I have working, the latter is my thinking for module devs that will create / maintain their own CRUD file in their module's namespace

Also, quicksketch is now another maintainer: he's got some itches to scratch for D6.

The D6 branch is crunchy crunchy code that is brand new. I know I've got bad logic in a couple of places, but needed to get this new stuff in there to show my direction for quicksketch.

I personally don't have plans to work on the Install Profile Wizard, but with the split out of .inc files per module, it should actually be even easier to auto-create .profile files.

I hand out CVS maintainership like candy for this module, so let me know if you want access.

Comments

Install Profile Wizard

dmitrig01's picture

Should go far away.

Far far away.

Many people have tried to tackle the challenge of creating install profiles programmatically, including myself.
It's just simply not possible to do in an extendible manner without many (tens of?) thousands of lines of code.

Good starting point

Boris Mann's picture

Lots of people were happy with the basic skeleton .profile files that WERE being created by the 5.x version with crud.inc dependencies.

This is one of those areas where there would be nothing if there weren't me the non-programmer hacking together a "better than nothing" solution :P Us Drupal people sometimes fall victim to the "great is the enemy of the good" (e.g. image handling in core).

I see it as a driver for better separation of CRUD functions for both core and contrib modules.

I'll poke the original creator after we do some more work on cleaning up install profile for D6: I think the new .inc per module could make things a little easier.

Hear hear

kyle_mathews's picture

Everyone should read this essay, The Rise of "Worse is Better", written back in the 1980s. As brilliant and true today as it was then.

The lesson to be learned from this is that it is often undesirable to go for the right thing first. It is better to get half of the right thing available so that it spreads like a virus. Once people are hooked on it, take the time to improve it to 90% of the right thing.

A decent Install Profile wizard would be brilliant Boris -- I salute your efforts.

Kyle Mathews

Kyle Mathews

Nice work.

alex_b's picture

I see it as a driver for better separation of CRUD functions for both core and contrib modules.

Right on.

Any work towards corresponding export functions? I'm thinking that every install_create() function should have a corresponding _export() function.

I whipped up a module with such functionality for a recent migration: it matches export with import (read: install) functions and thus allows some neat things like: batch export of site structure from one Drupal site to another one. All in 5 though. For 'import' functions I mostly wrote simple wrappers for install_profile_api :)

I'll clean up the code soon and get a proof of concept out.

Export would make sense for install profile wizard

Boris Mann's picture

Not really needed for install profile api. But, as we split out .inc files per module, can mirror the same thing as .export.inc?

"batch export of site structure from one Drupal site to another" -- that really just sounds like profile wizard.

And I'm going to focus on 6, so that ideally we have a good template for what might go into 7....

Port module

alex_b's picture

On the risk of going slightly OT:

I just comitted a cleaned up version from what I've been using last week:

http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/alex_b/port/

Port module basically defines a hook hook_ports() that allows modules to define a symmetrical pair of an import and an export function. Through this hook we know what functions match up and it becomes very easy to do batch import/export functionality (implemented in the proof of concept module).

With this information it is also very easy to generate import function compatible code as it is required for a installer profile wizard (not implemented in the proof of concept module).

Like crud.inc, it also strives to encourage good coding practice: make your create functions eat what your export functions generate!

I will write a more in depth blog post about port module soon...

O - and I borrowed crud.inc

alex_b's picture

O - and I borrowed crud.inc for it ;)

Overlap

alex_b's picture

There is overlap between install profile wizard, port and deploy:

http://heyrocker.com/drupal/content/deployment-and-change-management-fra...

Another thing to add to the mix

bonobo's picture

The staging module -- http://drupal.org/project/staging

More in line with port and deploy


FunnyMonkey
Tools for Teachers

Distribution profiles

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: