You are here

function configuration_write_export_file in Configuration Management 7

Writes configurations file that mirrors the data in {config_export} table.

12 calls to configuration_write_export_file()
configuration_download_config in ./configuration.admin.inc
Download the entire configuration packaged up into zip file
configuration_field_update_instance in observers/observer.field.inc
Implements hook_field_update_instance().
configuration_filter_format_update in observers/observer.filter.inc
Implements hook_filter_format_update().
configuration_image_style_save in observers/observer.image.inc
Implements hook_image_style_save().
configuration_menu_link_update in observers/observer.menu.inc
Implements hook_menu_link_update().

... See full list

File

./configuration.export.inc, line 809

Code

function configuration_write_export_file($config = NULL, $dest = NULL) {
  if (!$config) {
    cache_clear_all('config_export', 'cache');
  }
  $config = $config ? $config : configuration_get_configuration();
  $dest = $dest ? $dest : 'config://config.export';
  $h = fopen($dest, 'w');
  foreach ($config as $owner => $component) {
    if (is_array($component)) {
      foreach ($component as $name => $settings) {
        fwrite($h, 'config[' . $owner . '][' . $name . '][status] = ' . $settings['status'] . "\n");
        if (!empty($settings['hash'])) {
          fwrite($h, 'config[' . $owner . '][' . $name . '][hash] = \'' . $settings['hash'] . "'\n");
        }
        fwrite($h, 'config[' . $owner . '][' . $name . '][parent] = \'' . $settings['parent'] . "'\n");
        if (!empty($settings['dependencies'])) {
          fwrite($h, 'config[' . $owner . '][' . $name . '][dependencies] = \'' . $settings['dependencies'] . "'\n\n");
        }
      }
    }
  }
  fclose($h);
}