You are here

public function ConfigurationExportManager::dumpFiles in Configuration Management 7.3

1 call to ConfigurationExportManager::dumpFiles()
ConfigurationExportManager::export in src/Helpers/ConfigurationExportManager.php
Export the configuration of the site into the filesystem.

File

src/Helpers/ConfigurationExportManager.php, line 172
ConfigurationExportManager.php handles the export of configurations.

Class

ConfigurationExportManager

Namespace

Configuration\Helpers

Code

public function dumpFiles() {
  $config_path = drupal_realpath('public://' . rtrim($this->configuration_manager
    ->settings()
    ->get('export.path'), '/'));
  $this
    ->createDirectory($config_path);
  $export_format = $this->configuration_manager
    ->settings()
    ->get('export.format');
  $configurations = $this->configuration_manager
    ->cache()
    ->getAll();
  $step_level = count($configurations) / 10;
  $steps_completed = 0;
  $export_counter = 0;
  foreach ($configurations as $configuration) {
    $this
      ->dumpConfiguration($configuration, $config_path, $export_format);
    $export_counter++;
    if ($export_counter > $step_level) {
      $steps_completed += 10;
      echo "{$steps_completed}% completed\n";
      $export_counter = 0;
    }
  }
  $this
    ->createConfigurationsFile($config_path);
}