3 namespace Drupal\Core\Config;
6 * Defines an interface for comparison of configuration storage objects.
8 interface StorageComparerInterface {
11 * Gets the configuration source storage.
13 * @param string $collection
14 * (optional) The storage collection to use. Defaults to the
17 * @return \Drupal\Core\Config\StorageInterface
18 * Storage object used to read configuration.
20 public function getSourceStorage($collection = StorageInterface::DEFAULT_COLLECTION);
23 * Gets the configuration target storage.
25 * @param string $collection
26 * (optional) The storage collection to use. Defaults to the
29 * @return \Drupal\Core\Config\StorageInterface
30 * Storage object used to write configuration.
32 public function getTargetStorage($collection = StorageInterface::DEFAULT_COLLECTION);
35 * Gets an empty changelist.
38 * An empty changelist array.
40 public function getEmptyChangelist();
43 * Gets the list of differences to import.
46 * (optional) A change operation. Either delete, create or update. If
47 * supplied the returned list will be limited to this operation.
48 * @param string $collection
49 * (optional) The collection to get the changelist for. Defaults to the
53 * An array of config changes that are yet to be imported.
55 public function getChangelist($op = NULL, $collection = StorageInterface::DEFAULT_COLLECTION);
58 * Recalculates the differences.
60 * @return \Drupal\Core\Config\StorageComparerInterface
61 * An object which implements the StorageComparerInterface.
63 public function reset();
66 * Checks if there are any operations with changes to process.
68 * Until the changelist has been calculated this will always be FALSE.
71 * TRUE if there are changes to process and FALSE if not.
73 * @see \Drupal\Core\Config\StorageComparerInterface::createChangelist()
75 public function hasChanges();
78 * Validates that the system.site::uuid in the source and target match.
81 * TRUE if identical, FALSE if not.
83 public function validateSiteUuid();
86 * Moves a rename operation to an update.
88 * @param string $rename
89 * The rename name, as provided by ConfigImporter::createRenameName().
90 * @param string $collection
91 * (optional) The collection where the configuration is stored. Defaults to
92 * the default collection.
94 * @see \Drupal\Core\Config\ConfigImporter::createRenameName()
96 public function moveRenameToUpdate($rename, $collection = StorageInterface::DEFAULT_COLLECTION);
99 * Extracts old and new configuration names from a configuration change name.
101 * @param string $name
102 * The configuration change name, as provided by
103 * ConfigImporter::createRenameName().
106 * An associative array of configuration names. The array keys are
107 * 'old_name' and 'new_name' representing the old and new configuration
108 * object names during a rename operation.
110 * @see \Drupal\Core\Config\StorageComparer::createRenameNames()
112 public function extractRenameNames($name);
115 * Gets the existing collections from both the target and source storage.
117 * @param bool $include_default
118 * (optional) Include the default collection. Defaults to TRUE.
121 * An array of existing collection names.
123 public function getAllCollectionNames($include_default = TRUE);