X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Fcommands%2Fcore%2Fqueue.drush.inc;fp=vendor%2Fdrush%2Fdrush%2Fcommands%2Fcore%2Fqueue.drush.inc;h=0000000000000000000000000000000000000000;hp=7886e225bef31256c0e240b55d11fea06d800631;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/drush/drush/commands/core/queue.drush.inc b/vendor/drush/drush/commands/core/queue.drush.inc deleted file mode 100644 index 7886e225b..000000000 --- a/vendor/drush/drush/commands/core/queue.drush.inc +++ /dev/null @@ -1,95 +0,0 @@ - 'Run a specific queue by name', - 'arguments' => array( - 'queue_name' => 'The name of the queue to run, as defined in either hook_queue_info or hook_cron_queue_info.', - ), - 'required-arguments' => TRUE, - 'options' => array( - 'time-limit' => 'The maximum number of seconds allowed to run the queue', - ), - ); - $items['queue-list'] = array( - 'description' => 'Returns a list of all defined queues', - 'outputformat' => array( - 'default' => 'table', - 'pipe-format' => 'csv', - 'field-labels' => array( - 'queue' => 'Queue', - 'items' => 'Items', - 'class' => 'Class', - ), - 'ini-item' => 'items', - 'table-metadata' => array( - 'key-value-item' => 'items', - ), - 'output-data-type' => 'format-table', - ), - ); - - return $items; -} - -/** - * Validation callback for drush queue-run. - */ -function drush_queue_run_validate($queue_name) { - try { - $queue = drush_queue_get_class(); - $queue->getInfo($queue_name); - } - catch (\Drush\Queue\QueueException $exception) { - return drush_set_error('DRUSH_QUEUE_RUN_VALIDATION_ERROR', $exception->getMessage()); - } -} - -/** - * Return the appropriate queue class. - */ -function drush_queue_get_class() { - return drush_get_class('Drush\Queue\Queue'); -} - -/** - * Command callback for drush queue-run. - * - * Queue runner that is compatible with queues declared using both - * hook_queue_info() and hook_cron_queue_info(). - * - * @param $queue_name - * Arbitrary string. The name of the queue to work with. - */ -function drush_queue_run($queue_name) { - $queue = drush_queue_get_class(); - $time_limit = (int) drush_get_option('time-limit'); - $start = microtime(TRUE); - $count = $queue->run($queue_name, $time_limit); - $elapsed = microtime(TRUE) - $start; - drush_log(dt('Processed @count items from the @name queue in @elapsed sec.', array('@count' => $count, '@name' => $queue_name, '@elapsed' => round($elapsed, 2))), drush_get_error() ? LogLevel::WARNING : LogLevel::OK); -} - -/** - * Command callback for drush queue-list. - */ -function drush_queue_list() { - $queue = drush_queue_get_class(); - return $queue->listQueues(); -} -