| 1 |
<?php
|
| 2 |
|
| 3 |
|
| 4 |
function hosting_drush_command() {
|
| 5 |
$items['hosting dispatch'] = array(
|
| 6 |
'callback' => 'hosting_dispatch',
|
| 7 |
'description' => dt('Centralized command for dispatching the various queue processors (hosting, cron, backup etc.)'),
|
| 8 |
);
|
| 9 |
|
| 10 |
$items['hosting setup'] = array(
|
| 11 |
'callback' => 'hosting_setup',
|
| 12 |
'description' => dt('Set up initial configuration settings such as the cron entry for the queue dispatcher and more.'),
|
| 13 |
);
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
$queues = hosting_get_queues();
|
| 18 |
foreach ($queues as $queue => $info) {
|
| 19 |
$dispatch = dt("Dispatched: @items items every @frequency minutes", array('@items' => $info['items'], '@frequency' => round($info['frequency'] / 60)));
|
| 20 |
$items['hosting ' . $queue] = array(
|
| 21 |
'callback' => 'hosting_run_queue',
|
| 22 |
'description' => $info['description'] . " " . $dispatch,
|
| 23 |
'queue' => $queue,
|
| 24 |
);
|
| 25 |
}
|
| 26 |
|
| 27 |
$items['hosting task'] = array(
|
| 28 |
'description' => 'execute a specific queue item',
|
| 29 |
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL
|
| 30 |
);
|
| 31 |
|
| 32 |
return $items;
|
| 33 |
}
|
| 34 |
|
| 35 |
|