getOutput() public méthode

Returns the output handler.
public getOutput ( ) : Components_Output
Résultat Components_Output The output handler.
Exemple #1
0
 /**
  * Run a sequence of release tasks.
  *
  * @param array                $sequence The task sequence.
  * @param Components_Component $component The component to be released.
  * @param array                $options  Additional options.
  *
  * @return NULL
  */
 public function run(array $sequence, Components_Component $component, $options = array())
 {
     $this->_options = $options;
     $this->_sequence = $sequence;
     $task_sequence = array();
     foreach ($sequence as $name) {
         $task_sequence[] = $this->getTask($name, $component);
     }
     $errors = array();
     $selected_tasks = array();
     foreach ($task_sequence as $task) {
         $task_errors = $task->validate($options);
         if (!empty($task_errors)) {
             if ($task->skip($options)) {
                 $this->_dependencies->getOutput()->warn(sprintf("Deactivated task \"%s\":\n\n%s", $task->getName(), join("\n", $task_errors)));
             } else {
                 $errors = array_merge($errors, $task_errors);
             }
         } else {
             $selected_tasks[] = $task;
         }
     }
     if (!empty($errors)) {
         throw new Components_Exception("Unable to release:\n\n" . join("\n", $errors));
     }
     foreach ($selected_tasks as $task) {
         $task->run($options);
     }
 }
Exemple #2
0
 /**
  * Run a sequence of qc tasks.
  *
  * @param array                $sequence The task sequence.
  * @param Components_Component $component The component to be checked.
  * @param array                $options  Additional options.
  *
  * @return NULL
  */
 public function run(array $sequence, Components_Component $component, $options = array())
 {
     $this->_options = $options;
     $this->_sequence = $sequence;
     $task_sequence = array();
     foreach ($sequence as $name) {
         $task_sequence[] = $this->getTask($name, $component);
     }
     $selected_tasks = array();
     foreach ($task_sequence as $task) {
         $task_errors = $task->validate($options);
         if (!empty($task_errors)) {
             $this->_dependencies->getOutput()->warn(sprintf("Deactivated task \"%s\":\n\n%s", $task->getName(), join("\n", $task_errors)));
         } else {
             $selected_tasks[] = $task;
         }
     }
     $output = $this->_dependencies->getInstance('Components_Output');
     foreach ($selected_tasks as $task) {
         $output->bold(str_repeat('-', 30));
         $output->ok('Running ' . $task->getName() . ' on ' . $component->getName() . "\n");
         $numErrors = $task->run($options);
         $output->plain('');
         if ($numErrors == 1) {
             $output->warn("{$numErrors} error!");
         } else {
             if ($numErrors) {
                 $output->warn("{$numErrors} errors!");
             } else {
                 $output->ok('No problems found.');
             }
         }
         $output->bold(str_repeat('-', 30) . "\n");
     }
 }