Symfony\Component\Process\Process::isStarted PHP Method

isStarted() public method

Checks if the process has been started with no regard to the current state.
public isStarted ( ) : boolean
return boolean true if status is ready, false otherwise
    public function isStarted()
    {
        return $this->status != self::STATUS_READY;
    }

Usage Example

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $channels = [];
     $maxChannels = $input->getArgument('CPUs');
     $exampleArray = $this->getExampleArray();
     $output->writeln('<fg=green>Start example process</>');
     while (count($exampleArray) > 0 || count($channels) > 0) {
         foreach ($channels as $key => $channel) {
             if ($channel instanceof Process && $channel->isTerminated()) {
                 unset($channels[$key]);
             }
         }
         if (count($channels) >= $maxChannels) {
             continue;
         }
         if (!($item = array_pop($exampleArray))) {
             continue;
         }
         $process = new Process(sprintf('php index.php example:sub-process %s', $item), __DIR__ . '/../../../');
         $process->start();
         if (!$process->isStarted()) {
             throw new \Exception($process->getErrorOutput());
         }
         $channels[] = $process;
     }
     $output->writeln('<bg=green;fg=black>Done.</>');
 }
All Usage Examples Of Symfony\Component\Process\Process::isStarted