示例#1
0
 public function extractOutput($structured_data)
 {
     $return = drush_backend_get_result();
     if (empty($return)) {
         drush_backend_set_result($structured_data);
     }
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $args = $input->getArguments();
     $first = array_shift($args);
     // If the first argument is an alias, assign the next argument as the
     // command.
     if (strpos($first, '@') === 0) {
         $alias = $first;
         $command = array_shift($args);
     } else {
         $alias = '@self';
         $command = $first;
     }
     $options = $input->getOptions();
     // Force the 'backend' option to TRUE.
     $options['backend'] = TRUE;
     $return = drush_invoke_process($alias, $command, array_values($args), $options, ['interactive' => TRUE]);
     if ($return['error_status'] > 0) {
         foreach ($return['error_log'] as $error_type => $errors) {
             $output->write($errors);
         }
         // Add a newline after so the shell returns on a new line.
         $output->writeln('');
     } else {
         $output->page(drush_backend_get_result());
     }
 }