You are here

public static function ConfigurationManagement::stopTracking in Configuration Management 7.2

Removes a record of each configuration that is not tracked anymore and deletes the configuration file in the DataStore.

Parameters

array $list: The list of components that have to will be tracked.

boolean $track_dependencies: If TRUE, dependencies of each proccessed configuration will not be tracked anymore.

boolean $track_optionals: If TRUE, optionals configurations of each proccessed configuration will not be tracked anymore.

Return value

ConfigIteratorSettings An ConfigIteratorSettings object that contains configurations that are not tracked anymore.

6 calls to ConfigurationManagement::stopTracking()
ConfigurationApiTest::testStartAndStopTracking in tests/configuration.test
configuration_sync_configurations_submit in ui/configuration_ui.admin.inc
configuration_ui_stop_tracking_form_submit in ui/configuration_ui.admin.inc
Submit handler for stop tracking configs.
configuration_ui_stop_tracking_single_confirm_submit in ui/configuration_ui.admin.inc
Submit handler for stop tracking a single config.
_configuration_stop_tracking in ./configuration.drush.inc

... See full list

File

lib/Drupal/configuration/Config/ConfigurationManagement.php, line 193
Definition of Drupal\configuration\Config\ConfigurationManagement.

Class

ConfigurationManagement

Namespace

Drupal\configuration\Config

Code

public static function stopTracking($list = array(), $stop_track_dependencies = TRUE, $stop_track_optionals = TRUE) {
  $excluded = static::excludedConfigurations();
  $settings = new ConfigIteratorSettings(array(
    'build_callback' => 'build',
    'callback' => 'removeConfiguration',
    'process_dependencies' => $stop_track_dependencies,
    'process_optionals' => $stop_track_optionals,
    'settings' => array(
      'excluded' => $excluded,
    ),
    'info' => array(
      'untracked' => array(),
    ),
  ));
  if (Storage::checkFilePermissions('tracked.inc')) {
    foreach ($list as $component) {
      if (in_array($component, $excluded)) {
        continue;
      }
      $config = static::createConfigurationInstance($component);

      // Make sure the object is built before start to iterate on its
      // dependencies.
      $config
        ->setContext($settings);
      $config
        ->build();
      $config
        ->iterate($settings);
    }
    $tracked = static::trackedConfigurations();
    $args = array();
    foreach ($tracked as $component => $list) {
      foreach ($list as $identifier => $hash) {
        $id = $component . '.' . $identifier;
        $args[] = $id;
      }
    }
    static::exportToDataStore($args, TRUE, TRUE, TRUE);
  }
  return $settings;
}