' . t('About') . ''; $output .= '

' . t('The Configuration Manager module provides a user interface for importing and exporting configuration changes between installations of your website in different environments. Configuration is stored in YAML format. For more information, see the online documentation for the Configuration Manager module.', [':url' => 'https://www.drupal.org/documentation/administer/config']) . '

'; $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Exporting the full configuration') . '
'; $output .= '
' . t('You can create and download an archive consisting of all your site\'s configuration exported as *.yml files on the Export page.', [':url' => \Drupal::url('config.export_full')]) . '
'; $output .= '
' . t('Importing a full configuration') . '
'; $output .= '
' . t('You can upload a full site configuration from an archive file on the Import page. When importing data from a different environment, the site and import files must have matching configuration values for UUID in the system.site configuration item. That means that your other environments should initially be set up as clones of the target site. Migrations are not supported.', [':url' => \Drupal::url('config.import_full')]) . '
'; $output .= '
' . t('Synchronizing configuration') . '
'; $output .= '
' . t('You can review differences between the active configuration and an imported configuration archive on the Synchronize page to ensure that the changes are as expected, before finalizing the import. The Synchronize page also shows configuration items that would be added or removed.', [':synchronize' => \Drupal::url('config.sync')]) . '
'; $output .= '
' . t('Exporting a single configuration item') . '
'; $output .= '
' . t('You can export a single configuration item by selecting a Configuration type and Configuration name on the Single export page. The configuration and its corresponding *.yml file name are then displayed on the page for you to copy.', [':single-export' => \Drupal::url('config.export_single')]) . '
'; $output .= '
' . t('Importing a single configuration item') . '
'; $output .= '
' . t('You can import a single configuration item by pasting it in YAML format into the form on the Single import page.', [':single-import' => \Drupal::url('config.import_single')]) . '
'; $output .= '
'; return $output; case 'config.sync': $output = ''; $output .= '

' . t('Compare the configuration uploaded to your sync directory with the active configuration before completing the import.') . '

'; return $output; case 'config.export_full': $output = ''; $output .= '

' . t('Export and download the full configuration of this site as a gzipped tar file.') . '

'; return $output; case 'config.import_full': $output = ''; $output .= '

' . t('Upload a full site configuration archive to the sync directory. It can then be compared and imported on the Synchronize page.') . '

'; return $output; case 'config.export_single': $output = ''; $output .= '

' . t('Choose a configuration item to display its YAML structure.') . '

'; return $output; case 'config.import_single': $output = ''; $output .= '

' . t('Import a single configuration item by pasting its YAML structure into the text field.') . '

'; return $output; } } /** * Implements hook_file_download(). */ function config_file_download($uri) { $scheme = file_uri_scheme($uri); $target = file_uri_target($uri); if ($scheme == 'temporary' && $target == 'config.tar.gz') { if (\Drupal::currentUser()->hasPermission('export configuration')) { $request = \Drupal::request(); $date = DateTime::createFromFormat('U', $request->server->get('REQUEST_TIME')); $date_string = $date->format('Y-m-d-H-i'); $hostname = str_replace('.', '-', $request->getHttpHost()); $filename = 'config' . '-' . $hostname . '-' . $date_string . '.tar.gz'; $disposition = 'attachment; filename="' . $filename . '"'; return [ 'Content-disposition' => $disposition, ]; } return -1; } }