/ Published in: PHP
Drupal allows hook_update_N to run any sort of code. Most of the time, however, people only use this to alter the database scheme.
But you can use it for much more. Like setting variables, creating nodes, importing views and so on.
This code shows how to set a series of variables in Drupal.
When you deploy this code, running update.php will set all the variables as in the listing.
I typically catch this in a module called 'projectname_meta'. So this function would go in projectname_meta.install, and will be called from projectname_meta_install and projectname_meta_update_5002, for example.
But you can use it for much more. Like setting variables, creating nodes, importing views and so on.
This code shows how to set a series of variables in Drupal.
When you deploy this code, running update.php will set all the variables as in the listing.
I typically catch this in a module called 'projectname_meta'. So this function would go in projectname_meta.install, and will be called from projectname_meta_install and projectname_meta_update_5002, for example.
URL: http://wizzlern.nl