1 config.admin.inc config_download_full_export()

Downloads a tarball of the site configuration.

File

core/modules/config/config.admin.inc, line 201
Admin page callbacks for the Configuration Management module.

Code

function config_download_full_export() {
  $file_path = file_create_filename('config.tar.gz', file_directory_temp());
  $config_storage = config_get_config_storage();
  $config_storage->exportArchive($file_path);
  $filename = str_replace(file_directory_temp() . '/', '', $file_path);
  $headers = array(
    'Content-Disposition' => 'attachment; filename=config.tar.gz',
    'Content-type' => 'application/x-gzip',
  );
  file_transfer('temporary://' . $filename, $headers);
  file_unmanaged_delete($file_path);
}