Sample install profile: basic.profile

Events happening in the community are now at Drupal community events on www.drupal.org.
boris mann's picture

Hope everyone is enjoying 6th birthday/5.0 release day. I've been tinkering with install profiles, and have a working one in our public SVN. See https://svn.bryght.com/dev/browser/bryghtbase/DRUPAL-5/trunk/profiles/basic

If you've got control over your server space, you can actually check out the entire trunk (replace "browser" with "svn" to get the checkout URL -- e.g. https://svn.bryght.com/dev/svn/bryghtbase/DRUPAL-5/trunk/) and get all the supporting modules and a DRUPAL-5-0 install.

I've really been enjoying creating install profiles. There is lots more work to be done to really tune and smooth the edges of an install profile....but this is really just like developing a full Drupal site for a specific purpose.

My main points / tips are:

  • it's really easy to create install profiles -- you don't need to be a super developer
  • look through your "variables" table in a running install -- from the profile I made, you can see that a simple variable_set can set most things
  • copy/paste/edit works -- start with default.profile or the profile I've made, and edit things
  • get a process down for setting up / wiping / testing your environment -- this usually means command line tools

On that last point, it's fairly simple once you get the hang of it to go "mysqladmin create basic" (test test test) "mysql drop basic / mysql create basic" and keep working the same database. Also, you need to "reset" your settings.php each time...I usually delete my entire directory and make a fresh one by copying the _template file -- e.g. "cp -R _template/ example.com/", where example.com is the address where you are testing.

Comments

Thanks for these tips!

ximo's picture

On my OSX machine, I ended up having two Terminal windows, where one was connected to mysql and the other was for copying settings.php. I have no count for how many times I have done this:

In the Terminal window for mysql:
drop database test; create database test;

In the Terminal window for settings.php resetting:
cp template/sites/default/settings.php test/sites/default/settings.php

In Firefox:
Refresh
Enter database info
Save form
See if changes were successful

.. repeat untill done.

It's actually not as hard as I feared, but there were some issues. I also noticed you weren't as optimistic about install profiles some 10 days later ;) And I agree, some sort of CRUD API would be nice!

Actually

boris mann's picture

You don't need to remove settings.php at all. You just do drop / create and then hit install.php directly.

I'm optimistic about install profiles...just lots of things to dig through in creating various Drupal settings programmatically, rather than just database hacking.

all i get is blank screen

tomhung's picture

all i get is blank screen and no tables...

Greg

Distributions

Group organizers

Group notifications

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