You are here

function configuration_default_map in Configuration Management 6

The default configuration map that is applied to all configuration context objects. For the time being all it does is make it easier to visualize the incoming configuration data and set up the module list.

The original format of the incoming data is like: array( array( type => block, config => array( // config data ) ) array( type => block, config => array( // config data ) ) array( type => menu, config => array( // config data ) ) )

Applying a config path against an object like that would look like: /*[type=block]/config

When in realitiy all that should be needed is: /block

This is accomplished here by moving the config data a level above it and getting rid of the tag key from the data object completely. The tag key is set in the context object and is made to act as a secondary array key (the original is just an indexed number).

The new configuration looks like: array( array( array( // config data ) ) // secondary_key=block array( array( // config data ) ) // secondary_key=block array( array( // config data ) ) // secondary_key=menu )

1 call to configuration_default_map()
configuration_run_pass in ./configuration.module
Run through a pass of the configuration process

File

./configuration.module, line 578
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_default_map() {
  return array(
    '//*' => array(
      '#value callback' => 'configuration_find_attributes',
    ),
    // Convert tags starting with a # to attributes
    '/*/tag' => array(
      '#required' => true,
      '#context key' => true,
    ),
    '/*/config' => array(
      '#move' => '..',
    ),
    '/module' => array(
      '#array' => true,
    ),
    // TODO This is temporary since the next item can't catch these matches after the #alias yet
    '/modules' => array(
      '#alias' => array(
        'module',
      ),
      '#array' => true,
    ),
    '/modules/*' => array(
      '#enable module' => true,
    ),
  );
}