You are here

function configuration_build_configuration_status in Configuration Management 7

1 call to configuration_build_configuration_status()
configuration_get_configuration in ./configuration.module
Retrieve configurations that are being tracked

File

./configuration.module, line 786
Module file for the configuration module, which enables the capture and management of configuration in Drupal.

Code

function configuration_build_configuration_status() {
  $result = db_query("SELECT name, owner, status, hash, parent, dependencies FROM {config_export} WHERE status <> :status ORDER BY owner, name", array(
    ':status' => CONFIGURATION_DELETE,
  ))
    ->fetchAll();
  $config = array(
    'overridden' => 0,
  );
  foreach ($result as $comp) {
    $config[$comp->owner][$comp->name] = array(
      'status' => $comp->status,
      'hash' => $comp->hash,
      'parent' => $comp->parent,
      'dependencies' => $comp->dependencies,
    );

    // If anything is overriden, set a flag.
    if ($comp->status & CONFIGURATION_ACTIVESTORE_OVERRIDDEN) {
      $config['overridden'] = $config['overridden'] | $comp->status;
    }
    elseif ($comp->status & CONFIGURATION_DATASTORE_OVERRIDDEN) {
      $config['overridden'] = $config['overridden'] | $comp->status;
    }
    elseif ($comp->status & CONFIGURATION_DATASTORE_ONLY) {
      $config['overridden'] = $config['overridden'] | $comp->status;
    }
  }
  cache_set('config_export', $config);
  return $config;
}