forked from mlutfy/hosting_civicrm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hosting_civicrm.drush.inc
35 lines (31 loc) · 1.03 KB
/
hosting_civicrm.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
<?php
/**
* Implementation of hook_hosting_site_context_options().
*/
function hosting_civicrm_hosting_site_context_options(&$task) {
if (isset($task->ref->civicrm_version) && !empty($task->ref->civicrm_version)) {
$task->context_options['civicrm_version'] = $task->ref->civicrm_version;
}
else {
$task->context_options['civicrm_version'] = 'null';
}
if (isset($task->ref->civicrm_sitekey) && !empty($task->ref->civicrm_sitekey)) {
$task->context_options['civicrm_sitekey'] = $task->ref->civicrm_sitekey;
}
else {
$task->context_options['civicrm_sitekey'] = '';
}
}
/**
* Implementation of hook_drush_context_import().
*/
function hosting_civicrm_drush_context_import($context, &$node) {
if ($context->type == 'site') {
if (isset($context->civicrm_version) && !empty($context->civicrm_version)) {
$node->civicrm_version = $context->civicrm_version;
}
if (isset($context->civicrm_sitekey) && !empty($context->civicrm_sitekey)) {
$node->civicrm_sitekey = $context->civicrm_sitekey;
}
}
}