You are here

function strongarm_update_6201 in Strongarm 6.2

Update 6201: Set all strongarm 1.x variables that are not already set.

File

./strongarm.install, line 35

Code

function strongarm_update_6201() {
  $ret = array();
  $modules = module_implements('strongarm');
  foreach ($modules as $module) {
    $variables = module_invoke($module, 'strongarm');
    foreach ($variables as $variable => $value) {
      $exists = db_result(db_query("SELECT name FROM {variable} WHERE name = '%s'", $variable));
      if (!$exists && !(is_object($value) && isset($value->api_version))) {
        variable_set($variable, $value);
        $ret[] = array(
          'success' => TRUE,
          'query' => "Set 1.x strongarmed variable {$variable} in the database.",
        );
      }
    }
  }
  return $ret;
}