A couple of days ago a new unstable release for Drupal 7 was published. One of the many new wonderful features is that installation profiles are now treated as regular modules. This means that you no longer need to learn separate rules, use obscure functions or apply a special Install Profile API. If you know how to write a module, you now know how to write an installation profile. If you want to view a simple example of how this exactly works now, you can take a look at the expert installation profile that ships with Drupal 7.
As Angie mentioned on the dev mailing list:
Install profiles are now basically modules with .install files, .info files to declare dependencies, etc. If you can write a module, you can write an install profile, and you can also do everything from install profiles you can do with modules including use the full Drupal API and write update functions to move from one version to another.
If I remember correctly Starbow was the first to suggest this approach in a post dated about a year ago. It looks like things will work out just fine. Good stuff!
Promote this article on various sites:
Comments
Awesome.
Awesome.
I wish Install Profile could go away :(
Install Profile API was a) always meant as a stop gap and b) it still contains lots of helper functions for dealing with core and contrib modules (mainly CRUD so you're not writing db_query against the core / contrib database tables directly).
I would LOVE for it to go away completely, but there are still lots of settings accessible only through poking the database directly in core and contrib, AFAIK.
Hopefully this will spur people to patch / upgrade their modules to make all their settings settable programmatically (i.e. not just form submits on admin pages).
Hi Boris, You are correct.
Hi Boris,
You are correct. Some actions like adding a user to a specific role need to happen directly in the database. Drupal 7 still doesn't have an alternative to Install Profile API's install_add_user_to_role() for example. The good news is that some other actions that are in the Install Profile API are now officially in Drupal 7: install_add_permissions() can be replaced with user_role_set_permissions(), install_add_role() is now user_role_save(), et cetera. So I do believe that more installation profiles can be written without the extra API, but some will still need it.
Post new comment