You are here

function domain_drush_command in Domain Access 8

Same name and namespace in other branches
  1. 6.2 domain.drush.inc \domain_drush_command()
  2. 7.3 domain.drush.inc \domain_drush_command()
  3. 7.2 domain.drush.inc \domain_drush_command()

Implements hook_drush_command().

1 call to domain_drush_command()
domain_drush_help in domain/domain.drush.inc
Implements hook_drush_help().

File

domain/domain.drush.inc, line 15
Drush commands for Domain Access.

Code

function domain_drush_command() {
  $items = [];
  $items['domain-list'] = [
    'description' => 'List active domains for the site.',
    'examples' => [
      'drush domain-list',
      'drush domains',
    ],
    'aliases' => [
      'domains',
    ],
  ];
  $items['domain-add'] = [
    'description' => 'Add a new domain to the site.',
    'examples' => [
      'drush domain-add example.com \'My Test Site\'',
      'drush domain-add example.com \'My Test Site\' --inactive=1 --https==1',
      'drush domain-add example.com \'My Test Site\' --weight=10',
      'drush domain-add example.com \'My Test Site\' --validate=1',
    ],
    'arguments' => [
      'hostname' => 'The domain hostname to register (e.g. example.com).',
      'name' => 'The name of the site (e.g. Domain Two).',
    ],
    'options' => [
      'inactive' => 'Set the domain to inactive status if set.',
      'https' => 'Use https protocol for this domain if set.',
      'weight' => 'Set the order (weight) of the domain.',
      'is_default' => 'Set this domain as the default domain.',
      'validate' => 'Force a check of the URL response before allowing registration.',
    ],
  ];
  $items['domain-delete'] = [
    'description' => 'Delete a domain from the site.',
    'examples' => [
      'drush domain-delete example.com',
      'drush domain-delete 1',
    ],
    'arguments' => [
      'domain' => 'The numeric id or hostname of the domain to delete.',
    ],
  ];
  $items['domain-test'] = [
    'description' => 'Tests domains for proper response. If run from a subfolder, you must specify the --uri.',
    'examples' => [
      'drush domain-test',
      'drush domain-test example.com',
      'drush domain-test 1',
    ],
    'arguments' => [
      'domain_id' => 'The numeric id or hostname of the domain to test. If no value is passed, all domains are tested.',
    ],
    'options' => [
      'base_path' => 'The subdirectory name if Drupal is installed in a folder other than server root.',
    ],
  ];
  $items['domain-default'] = [
    'description' => 'Sets the default domain. If run from a subfolder, you must specify the --uri.',
    'examples' => [
      'drush domain-default example.com',
      'drush domain-default 1',
      'drush domain-default 1 --validate=1',
    ],
    'arguments' => [
      'domain_id' => 'The numeric id or hostname of the domain to make default.',
    ],
    'options' => [
      'validate' => 'Force a check of the URL response before allowing registration.',
    ],
  ];
  $items['domain-disable'] = [
    'description' => 'Sets a domain status to off.',
    'examples' => [
      'drush domain-disable example.com',
      'drush domain-disable 1',
    ],
    'arguments' => [
      'domain_id' => 'The numeric id or hostname of the domain to disable.',
    ],
  ];
  $items['domain-enable'] = [
    'description' => 'Sets a domain status to on.',
    'examples' => [
      'drush domain-disable example.com',
      'drush domain-disable 1',
    ],
    'arguments' => [
      'domain_id' => 'The numeric id or hostname of the domain to enable.',
    ],
  ];
  $items['domain-name'] = [
    'description' => 'Changes a domain label.',
    'examples' => [
      'drush domain-name example.com Foo',
      'drush domain-name 1 Foo',
    ],
    'arguments' => [
      'domain_id' => 'The numeric id or hostname of the domain to relabel.',
      'name' => 'The name to use for the domain.',
    ],
  ];
  $items['domain-machine-name'] = [
    'description' => 'Changes a domain name.',
    'examples' => [
      'drush domain-machine-name example.com foo',
      'drush domain-machine-name 1 foo',
    ],
    'arguments' => [
      'domain_id' => 'The numeric id or hostname of the domain to rename.',
      'name' => 'The machine-readable name to use for the domain.',
    ],
  ];
  $items['domain-scheme'] = [
    'description' => 'Changes a domain scheme.',
    'examples' => [
      'drush domain-scheme example.com https',
      'drush domain-scheme 1 https',
    ],
    'arguments' => [
      'domain_id' => 'The numeric id or hostname of the domain to change.',
      'scheme' => 'The URL schema (http or https) to use for the domain.',
    ],
  ];
  $items['generate-domains'] = [
    'description' => 'Generate domains for testing.',
    'arguments' => [
      'primary' => 'The primary domain to use. This will be created and used for *.example.com hostnames.',
    ],
    'options' => [
      'count' => 'The count of extra domains to generate. Default is 15.',
      'empty' => 'Pass empty=1 to truncate the {domain} table before creating records.',
    ],
    'examples' => [
      'drush domain-generate example.com',
      'drush domain-generate example.com --count=25',
      'drush domain-generate example.com --count=25 --empty=1',
      'drush gend',
      'drush gend --count=25',
      'drush gend --count=25 --empty=1',
    ],
    'aliases' => [
      'gend',
    ],
  ];
  return $items;
}