Change record status: 
Project: 
Introduced in branch: 
8.8.x
Introduced in version: 
8.8.0-ALPHA1
Description: 

Drupal core up to 8.8 did not have any API to export configuration.
Third party tools such as Drush and Drupal Console had to implement their own logic to export the configuration.
The common denominator is to read the configuration from the active storage and write it to some other storage.

In preparation of further improvements to Drupals configuration management workflows we add a new service to load a configuration store that is ready to be exported from.

Before this change code typically looked something like this:

    /** @var \Drupal\Core\Config\StorageInterface $source */
    /** @var \Drupal\Core\Config\StorageInterface $sync */
    $source = \Drupal::service('config.storage');

    // Your custom code for writing the config here.
    foreach ($source->listAll() as $name) {
      $sync->write($name, $source->read($name));
    }

After 8.8.0 code should look like this:

    /** @var \Drupal\Core\Config\StorageInterface $source */
    /** @var \Drupal\Core\Config\StorageInterface $sync */
    $source = \Drupal::service('config.storage.export');

    // Your custom code for writing the config here.
    foreach ($source->listAll() as $name) {
      $sync->write($name, $source->read($name));
    }

In summary: instead of exporting configuration directly from the active storage, use the config.storage.export storage.

Impacts: 
Module developers