コード例 #1
0
ファイル: ServerRun.php プロジェクト: robbert-vdh/bolt
 /**
  * @param SymfonyStyle $io
  * @param string       $address
  * @param string       $webDir
  * @param string       $router
  *
  * @return null|\Symfony\Component\Process\Process
  */
 protected function createServerProcess(SymfonyStyle $io, $address, $webDir, $router)
 {
     if (!file_exists($router)) {
         $io->error(sprintf('The router script "%s" does not exist', $router));
         return null;
     }
     $finder = new PhpExecutableFinder();
     if (($binary = $finder->find()) === false) {
         $io->error('Unable to find PHP binary to run server.');
         return null;
     }
     $builder = new ProcessBuilder([$binary, '-S', $address, '-t', $webDir, $router]);
     $builder->setTimeout(null);
     if ($io->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) {
         $builder->disableOutput();
     }
     return $builder->getProcess();
 }
コード例 #2
0
 /**
  * Disables fetching output and error output from the underlying process.
  *
  * @return ProcessBuilderProxyInterface
  */
 public function disableOutput() : ProcessBuilderProxyInterface
 {
     $this->processBuilder->disableOutput();
     return $this;
 }