1 system.install system_update_1018()

Moves authorize system settings from variable to config.

Related topics

File

core/modules/system/system.install, line 1959
Install, update and uninstall functions for the system module.

Code

function system_update_1018() {
  // Migrate variables to config.
  $config = config('system.authorize');
  $config->set('filetransfer_default', update_variable_get('authorize_filetransfer_default', ''));
  $settings = db_query("SELECT name, value FROM variable WHERE name LIKE 'authorize_filetransfer_connection_settings_%'");
  foreach ($settings as $row) {
    $row = unserialize($row);
    $config->set('authorize_filetransfer_connection_settings_' . $row[0], $row[1]);
  }
  $config->save();

  // Delete variables.
  update_variable_del('allow_authorize_operations');
  update_variable_del('authorize_filetransfer_default');

}