You are here

public function ConfigurationExportManager::checkForCircularDependecy in Configuration Management 7.3

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

File

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

Class

ConfigurationExportManager

Namespace

Configuration\Helpers

Code

public function checkForCircularDependecy() {
  $resolver = new DependencyResolver();
  foreach ($this->configuration_manager
    ->cache()
    ->getAll() as $configuration) {
    $resolver
      ->addComponent($configuration
      ->getIdentifier(), $configuration
      ->getDependencies());
  }
  try {

    // The list of Configurations sorted by order of import.
    $ordered = $resolver
      ->resolveDependencies();
  } catch (Exception $e) {
    if ($e
      ->getMessage() == "Circular dependency detected") {
      return FALSE;
    }
    if (strpos($e
      ->getMessage(), "There is a component not defined") !== FALSE) {
      return FALSE;
    }
  }
  return $ordered;
}