Symfony\Component\Console\Style\SymfonyStyle::write PHP Method

write() public method

public write ( $messages, $newline = false, $type = self::OUTPUT_NORMAL )
    public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
    {
        parent::write($messages, $newline, $type);
        $this->bufferedOutput->write($this->reduceBuffer($messages), $newline, $type);
    }

Usage Example

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output = new SymfonyStyle($input, $output);
     $workerCount = $input->getOption('count');
     $queues = $this->createQueues($input->getArgument('queues'));
     $output->write($queues);
     // This method of worker setup requires an array of queues
     if (!is_array($queues)) {
         throw new \Exception("Queues not initialized correctly");
     }
     $workers = array();
     for ($i = 0; $i < $workerCount; ++$i) {
         $worker = $this->workerFactory->createWorker();
         $workerProcess = $this->workerFactory->createWorkerProcess($worker);
         foreach ($queues as $queue) {
             $worker->addQueue($queue);
         }
         $workers[] = $workerProcess;
     }
     $this->foreman->pruneDeadWorkers();
     $this->foreman->work($workers, $input->getOption('wait'));
     echo sprintf('%d workers attached to the %s queues successfully started.', count($workers), implode($queues, ','));
     //        echo sprintf(
     //            'Workers (%s)',
     //            implode(', ', $workers)
     //        );
 }
All Usage Examples Of Symfony\Component\Console\Style\SymfonyStyle::write