You are here

function xmlsitemap_engines_update_6106 in XML sitemap 6

Implementation of hook_update_N().

File

xmlsitemap_engines/xmlsitemap_engines.install, line 47
Installation file for XML sitemap engines.

Code

function xmlsitemap_engines_update_6106() {
  $variables = array(
    'submit',
    'log_access',
    'cron_submit_frequency',
    'cron_submit_delay',
  );
  foreach ($variables as $variable) {
    $oldname = "xmlsitemap_{$variable}";
    $newname = "xmlsitemap_engines_{$variable}";
    $value = variable_get($oldname, FALSE);
    if ($value !== FALSE) {
      variable_set($newname, $value);
      variable_del($oldname);
      $ret[] = array(
        'success' => TRUE,
        'query' => "Variable name changed from {$oldname} to {$newname}.",
      );
    }
  }
  $ret[] = update_sql("UPDATE {system} SET weight = 15 WHERE name = 'xmlsitemap_engines'");
  return $ret;
}