Symfony\Component\Process\Process::setPty PHP Method

setPty() public method

Sets PTY mode.
public setPty ( boolean $bool ) : self
$bool boolean
return self
    public function setPty($bool)
    {
        $this->pty = (bool) $bool;
        return $this;
    }

Usage Example

 private function asseticDump(OutputInterface $output, KernelInterface $kernel)
 {
     $consolePath = $kernel->getRootDir() . '/console';
     $assetProcess = new Process('php ' . $consolePath . ' assets:install --env=prod && php ' . $consolePath . ' assetic:dump --env=prod &&  php ' . $consolePath . ' cache:clear --env=prod', $kernel->getRootDir() . '/..', null, null, 600);
     $assetProcess->setPty(true);
     try {
         $assetProcess->mustRun();
         $output->writeln($assetProcess->getOutput());
     } catch (ProcessFailedException $e) {
         echo $e->getMessage();
         $output->writeln($e->getMessage());
     }
     if ($assetProcess->isSuccessful()) {
         $output->writeln('<info>Assets succesfully installed</info>');
     } else {
         $output->writeln('<error>Assets installation failed</error>');
     }
 }
All Usage Examples Of Symfony\Component\Process\Process::setPty