function strongarm_update_7201 in Strongarm 7.2
Transition Strongarm variables from code to the database.
File
- ./
strongarm.install, line 23 - Install, update and uninstall functions for the strongarm module.
Code
function strongarm_update_7201() {
module_load_include('module', 'strongarm');
$variables = strongarm_vars_load(TRUE, TRUE);
if (!empty($variables)) {
foreach ($variables as $var_name => $var) {
$exists = db_query("SELECT name FROM {variable} WHERE name = :name", array(
':name' => $var_name,
))
->fetchField();
if (!$exists) {
variable_set($var_name, $var->value);
}
}
}
}