domain.drush.inc in Domain Access 6.2
Same filename and directory in other branches
Drush commands for Domain Access.
File
domain.drush.incView source
<?php
/**
* @file
* Drush commands for Domain Access.
*/
/**
* Implement hook_drush_command().
*/
function domain_drush_command() {
$items = array();
$items['domain-list'] = array(
'description' => 'List active domains for the site.',
);
return $items;
}
/**
* Implement hook_drush_help().
*/
function domain_drush_help($section) {
$items = domain_drush_command();
$name = str_replace('domain:', '', $section);
if (isset($items[$name])) {
return dt($items[$name]['description']);
}
}
/**
* Show the domain list.
*/
function drush_domain_list() {
$domains = domain_domains();
$header = array(
'sitename' => dt('sitename'),
'subdomain' => dt('domain'),
'scheme' => dt('scheme'),
'valid' => dt('active'),
'domain_id' => dt('domain_id'),
);
$rows = array(
array_values($header),
);
foreach ($domains as $domain) {
$row = array();
foreach ($header as $key => $name) {
$row[] = check_plain($domain[$key]);
}
$rows[] = $row;
}
drush_print_table($rows, TRUE);
}
Functions
Name | Description |
---|---|
domain_drush_command | Implement hook_drush_command(). |
domain_drush_help | Implement hook_drush_help(). |
drush_domain_list | Show the domain list. |