-
Notifications
You must be signed in to change notification settings - Fork 0
/
archimedes.drush.inc
52 lines (45 loc) · 1.43 KB
/
archimedes.drush.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* @file
* Drush integration for the archimedes module.
*/
/**
* Implements hook_drush_command().
*/
function archimedes_drush_command() {
$items['arch-xml'] = array(
'description' => "Provides a dump of the current XML output.",
);
$items['arch-send'] = array(
'description' => "Provides a dump of the current XML output.",
'options' => array(
'unencrypt' => 'Even if an encryption key is stored, send unencrypted.',
'mail' => 'Specify a target email address.',
),
'examples' => array(
'drush arch-send' => 'Send XML update using default settings.',
'drush arch-send --unencrypt [email protected]' => 'Send XML update unencrytped to chosen email address.',
'drush -l http://website.com arch-send' => 'Send XML update for a specific servername.',
),
);
return $items;
}
/**
* Command callback. Output XML.
*/
function drush_archimedes_arch_xml() {
require_once dirname(__FILE__) . '/archimedes.inc';
$owl = archimedes_build_report();
drush_print("\n" . $owl->toXML() . "\n");
}
/**
* Command callback. Send an update to configured email address.
*/
function drush_archimedes_arch_send() {
require_once dirname(__FILE__) . '/archimedes.inc';
archimedes_send_report();
$messages = drupal_set_message();
if (isset($messages['warning'])) {
drupal_set_message('Try using drush -l http://servername if servername cannot be determined.','warning');
}
}