-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathislandora_multi_importer.drush.inc
41 lines (37 loc) · 1.35 KB
/
islandora_multi_importer.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
<?php
/**
* @file
* Drush hooks.
* @author Diego Pino Navarro
*/
/**
* Implements hook_drush_command().
*/
function islandora_multi_importer_drush_command() {
$items = array();
$items['islandora-multi-importer-zeromqboot'] = array(
'aliases' => array('imzmqboot'),
'description' => 'Spawn an Islandora Multi Importer ZeroMQ server/workers ensamble',
'drupal dependencies' => array('islandora_multi_importer'),
'callback' => 'drush_islandora_multi_importer_zeromqboot',
'examples' => array(
'drush -v --user=admin islandora_multi_importer_zeromqboot',
),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
);
return $items;
}
/**
* Builds a preprocessor, and passes it off to a preprocessor handler.
*/
function drush_islandora_multi_importer_zeromqboot() {
// XXX: Due to how Drush bootstrapping works, the connection may be created
// without credentials (when your site's front page is
// 'islandora/object/some:object', for example). Resetting to ensure a new
// connection gets created should fix it.
module_load_include('inc', 'islandora_multi_importer', 'includes/zeroMQ');
module_load_include('inc', 'islandora_multi_importer', 'includes/zmsg');
drupal_static_reset('islandora_get_tuque_connection');
$connection = islandora_get_tuque_connection();
$boot = islandora_multi_importer_zeroMQ_boot($connection);
}