1 redirect.install redirect_update_1000()

Upgrade Drupal 7 Redirect variables to config.

File

core/modules/redirect/redirect.install, line 114
Install, update and uninstall functions for the Redirect module.

Code

function redirect_update_1000() {
  // Write the initial config file.
  $config = config('redirect.settings');
  $config->set('auto_redirect', update_variable_get('redirect_auto_redirect', TRUE));
  $config->set('passthrough_querystring', update_variable_get('redirect_passthrough_querystring', TRUE));
  $config->set('default_status_code', update_variable_get('redirect_default_status_code', '301'));
  $config->set('purge_inactive', update_variable_get('redirect_purge_inactive', FALSE));
  $config->save();

  // Remove old variables.
  update_variable_del('redirect_auto_redirect');
  update_variable_del('redirect_passthrough_querystring');
  update_variable_del('redirect_warning');
  update_variable_del('redirect_default_status_code');
  update_variable_del('redirect_page_cache');
  update_variable_del('redirect_purge_inactive');
}