You are here

public function Configuration::loadFromStorage in Configuration Management 7.2

Load the Configuration data from the disk.

1 call to Configuration::loadFromStorage()
Configuration::import in lib/Drupal/configuration/Config/Configuration.php
Load a configuration from the DataStore and save it into the ActiveStore. This function is called from iterator().

File

lib/Drupal/configuration/Config/Configuration.php, line 214
Definition of Drupal\configuration\Config\Configuration.

Class

Configuration

Namespace

Drupal\configuration\Config

Code

public function loadFromStorage() {
  $source = NULL;
  if (isset($this->context)) {
    $source = $this->context
      ->getSetting('source');
  }
  $this->storage
    ->load(NULL, $source);

  // Check if thereis a context defined, then we are iterating.
  if (isset($this->context)) {

    // Check that this configuration is supported by Configuration Management
    if (!ConfigurationManagement::validApiVersion($this->storage
      ->getApiVersion())) {
      $this->broken = TRUE;
      return $this;
    }
  }
  $this
    ->setData($this->storage
    ->getData());
  $this
    ->setDependencies($this->storage
    ->getDependencies());
  $this
    ->setOptionalConfigurations($this->storage
    ->getOptionalConfigurations());
  $this
    ->setModules($this->storage
    ->getModules());

  // This build the Hash;
  $this->storage
    ->getDataToSave();
  $this
    ->setHash($this->storage
    ->getHash());
  $this->built = TRUE;
  return $this;
}