Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Config / StorageComparerInterface.php
1 <?php
2
3 namespace Drupal\Core\Config;
4
5 /**
6  * Defines an interface for comparison of configuration storage objects.
7  */
8 interface StorageComparerInterface {
9
10   /**
11    * Gets the configuration source storage.
12    *
13    * @param string $collection
14    *   (optional) The storage collection to use. Defaults to the
15    *   default collection.
16    *
17    * @return \Drupal\Core\Config\StorageInterface
18    *   Storage object used to read configuration.
19    */
20   public function getSourceStorage($collection = StorageInterface::DEFAULT_COLLECTION);
21
22   /**
23    * Gets the configuration target storage.
24    *
25    * @param string $collection
26    *   (optional) The storage collection to use. Defaults to the
27    *   default collection.
28    *
29    * @return \Drupal\Core\Config\StorageInterface
30    *   Storage object used to write configuration.
31    */
32   public function getTargetStorage($collection = StorageInterface::DEFAULT_COLLECTION);
33
34   /**
35    * Gets an empty changelist.
36    *
37    * @return array
38    *   An empty changelist array.
39    */
40   public function getEmptyChangelist();
41
42   /**
43    * Gets the list of differences to import.
44    *
45    * @param string $op
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
50    *   default collection.
51    *
52    * @return array
53    *   An array of config changes that are yet to be imported.
54    */
55   public function getChangelist($op = NULL, $collection = StorageInterface::DEFAULT_COLLECTION);
56
57   /**
58    * Recalculates the differences.
59    *
60    * @return \Drupal\Core\Config\StorageComparerInterface
61    *   An object which implements the StorageComparerInterface.
62    */
63   public function reset();
64
65   /**
66    * Checks if there are any operations with changes to process.
67    *
68    * Until the changelist has been calculated this will always be FALSE.
69    *
70    * @return bool
71    *   TRUE if there are changes to process and FALSE if not.
72    *
73    * @see \Drupal\Core\Config\StorageComparerInterface::createChangelist()
74    */
75   public function hasChanges();
76
77   /**
78    * Validates that the system.site::uuid in the source and target match.
79    *
80    * @return bool
81    *   TRUE if identical, FALSE if not.
82    */
83   public function validateSiteUuid();
84
85   /**
86    * Moves a rename operation to an update.
87    *
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.
93    *
94    * @see \Drupal\Core\Config\ConfigImporter::createRenameName()
95    */
96   public function moveRenameToUpdate($rename, $collection = StorageInterface::DEFAULT_COLLECTION);
97
98   /**
99    * Extracts old and new configuration names from a configuration change name.
100    *
101    * @param string $name
102    *   The configuration change name, as provided by
103    *   ConfigImporter::createRenameName().
104    *
105    * @return array
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.
109    *
110    * @see \Drupal\Core\Config\StorageComparer::createRenameNames()
111    */
112   public function extractRenameNames($name);
113
114   /**
115    * Gets the existing collections from both the target and source storage.
116    *
117    * @param bool $include_default
118    *   (optional) Include the default collection. Defaults to TRUE.
119    *
120    * @return array
121    *   An array of existing collection names.
122    */
123   public function getAllCollectionNames($include_default = TRUE);
124
125 }