You are here

public function StoragePhp::load in Configuration Management 7.2

Loads the configuration object from the DataStore.

Parameters

$file_content: Optional. The content to load directly.

$source: Optional. An optional path to load the configuration.

Overrides Storage::load

File

lib/Drupal/configuration/Storage/StoragePhp.php, line 130
Definition of Drupal\configuration\Storage\StoragePhp.

Class

StoragePhp

Namespace

Drupal\configuration\Storage

Code

public function load($file_content = NULL, $source = NULL) {
  if (empty($this->loaded)) {
    $this->loaded = TRUE;
    if (empty($file_content)) {
      $dir = $source ? $source : ConfigurationManagement::getStream();
      if (!file_exists($dir . '/' . $this->filename)) {
        $this->data = NULL;
      }
      else {
        $file_content = drupal_substr(file_get_contents($dir . '/' . $this->filename), 6);
      }
    }
    if (!empty($file_content)) {
      $this
        ->import($file_content);
    }
  }
  return $this;
}