You are here

function configuration_drush_command in Configuration Management 7.2

Implements of hook_drush_command().

File

./configuration.drush.inc, line 40
configuration.drush.inc Let you perform configuration actions from the console.

Code

function configuration_drush_command() {
  $items = array();
  $items['config-get-identifiers'] = array(
    'callback' => '_configuration_get_identifiers',
    'description' => 'Return the list of identifiers for a given component.',
    'aliases' => array(
      'cgi',
    ),
    'examples' => array(
      'drush cgi content_type' => 'Return the list of all available content types to export',
    ),
    'arguments' => array(
      'component' => 'The name of the component to get the identifiers',
    ),
  );
  $items['config-get-components'] = array(
    'callback' => '_configuration_get_components',
    'description' => 'Return the list of configurations components that can be exported.',
    'aliases' => array(
      'cgc',
    ),
    'examples' => array(
      'drush cgc' => 'Return the list of all available configuration components that can be exported',
    ),
    'arguments' => array(),
  );
  $items['config-get-tracked'] = array(
    'callback' => '_configuration_get_tracked',
    'description' => 'Return the list of configurations components that are tracked.',
    'aliases' => array(
      'cgt',
    ),
    'examples' => array(
      'drush cgt' => 'Return the list of configurations components that are tracked.',
    ),
    'arguments' => array(),
  );
  $items['config-get-non-tracked'] = array(
    'callback' => '_configuration_get_not_tracked',
    'description' => 'Return the list of configurations components that are not tracked.',
    'aliases' => array(
      'cgnt',
    ),
    'examples' => array(
      'drush cgnt' => 'Return the list of configurations components that are not tracked.',
    ),
    'arguments' => array(),
  );
  $items['config-export'] = array(
    'callback' => '_configuration_export_to_datastore',
    'description' => 'Export a configuration to the datastore.',
    'aliases' => array(
      'cexp',
    ),
    'examples' => array(
      'drush cexp --all' => 'Export all tracked components',
      'drush cexp content_type.article' => 'Export the content type article and all its dependencies to the datastore',
      'drush cexp content_type.article --exclude-dependencies --exclude-optionals' => 'Export the only the content type article to the datastore  without include its dependencies and optional configurations.',
    ),
    'options' => array(
      'all' => 'Export all tracked components',
      'exclude-dependencies' => 'Export a configuration without export its dependencies.',
      'exclude-optionals' => 'Export a configuration without export its optional configurations.',
      'start-tracking' => 'Export a configuration and automatically start to tracking it.',
    ),
    'arguments' => array(),
  );
  $items['config-start-tracking'] = array(
    'callback' => '_configuration_start_tracking',
    'description' => 'Start tracking configuration changes.',
    'aliases' => array(
      'csta',
    ),
    'examples' => array(
      'drush csta --all' => 'Start tracking changes in all configurations',
      'drush csta content_type.article' => 'Start tracking changes in the content type article and in all its dependencies',
    ),
    'options' => array(
      'all' => 'Start tracking all components',
      'exclude-dependencies' => 'Export a configuration without export its dependencies.',
      'exclude-optionals' => 'Export a configuration without export its optional configurations.',
    ),
    'arguments' => array(),
  );
  $items['config-stop-tracking'] = array(
    'callback' => '_configuration_stop_tracking',
    'description' => 'Stop tracking configuration changes.',
    'aliases' => array(
      'csto',
    ),
    'examples' => array(
      'drush csto --all' => 'Stop tracking changes in all identifiers',
      'drush csto content_type.article' => 'Stop tracking changes in the content type article and in all its dependencies',
    ),
    'options' => array(
      'all' => 'Stop tracking all components',
      'exclude-dependencies' => 'Export a configuration without export its dependencies.',
      'exclude-optionals' => 'Export a configuration without export its optional configurations.',
    ),
    'arguments' => array(),
  );
  $items['config-list'] = array(
    'callback' => '_configuration_list',
    'description' => 'Return the list of components and identifiers',
    'aliases' => array(
      'clist',
    ),
    'examples' => array(
      'drush clist' => 'Return the list of components and identifiers',
    ),
  );
  $items['config-sync'] = array(
    'callback' => '_configuration_sync',
    'description' => 'Synchronize configurations',
    'aliases' => array(
      'csyn',
    ),
    'examples' => array(
      'drush config-sync' => 'Enable all the required modules and the configurations defined in tracked.inc',
      'drush config-sync --preserve-tracked' => 'Will keep tracking the previous configurations even if they are not listed in the tracked.inc',
      'drush csyn --source=%site/myconfig' => 'Synchronize configurations from drupal/sites/example.com/myconfig/tracked.inc',
      'drush csyn --source=myconfig' => 'Synchronize configurations from drupal/myconfig/tracked.inc',
      'drush csyn --source=/path/to/myconfig' => 'Synchronize configurations from /path/to/myconfig/tracked.inc',
    ),
    'options' => array(
      'source' => 'import all the configurations from a given directory.',
      'preserve-tracked' => 'By default, all configurations that are not listed on the tracked.inc file are automatically untracked. Using this options avoid remove the already being tracked configurations.',
    ),
  );
  return $items;
}