You are here

function configuration_set_data in Configuration Management 6

Set static data to be retrieved during later phases

Parameters

$type: The type of data being stored, such as 'phase', 'build', 'action', 'cleanup' etc...

$data: The actual data needing stored

$cache: Set the full static $store of data with this $cache

Return value

The specific data needed if $type is set, or all of the stored data

6 calls to configuration_set_data()
configuration_drupal_execute in ./configuration.module
Do the actual drupal execute on an action
configuration_execute in ./configuration.module
Execute a configuration diven a data object of actions. The supplied data should be a php array in the correct format.
configuration_get_data in ./configuration.module
Get data from the static data store
configuration_initiate in ./configuration.module
Initialize whats needed to execute a configuration.
configuration_set_error in ./configuration.module
Set an error during configuration setup

... See full list

File

./configuration.module, line 1273
Provide a unified method for defining site configurations abstracted from their data format. Various data formats should be supported via a plugin architecture such as XML, YAML, JSON, PHP

Code

function &configuration_set_data($type = null, $data = null, $cache = null) {
  static $store = array();

  // Set the store if a cache is given
  if ($cache) {
    $store = $cache;
  }

  // We have to have a unique execute id to deal with data stores
  if (!($current_id = configuration_get_current_id()) && !($current_id = $store['current_id'])) {
    return;
  }
  else {
    $store['current_id'] = $current_id;
  }
  if (isset($type) && isset($data)) {
    $store[$current_id][$type] = $data;
  }
  else {
    if (isset($type) && !isset($store[$current_id][$type])) {
      $store[$current_id][$type] = null;
    }
  }
  if ($type) {
    return $store[$current_id][$type];
  }
  else {
    return $store;
  }
}