本文整理匯總了PHP中Symfony\Component\Process\ProcessBuilder::disableOutput方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProcessBuilder::disableOutput方法的具體用法?PHP ProcessBuilder::disableOutput怎麽用?PHP ProcessBuilder::disableOutput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Process\ProcessBuilder
的用法示例。
在下文中一共展示了ProcessBuilder::disableOutput方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createServerProcess
/**
* @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: disableOutput
/**
* Disables fetching output and error output from the underlying process.
*
* @return ProcessBuilderProxyInterface
*/
public function disableOutput() : ProcessBuilderProxyInterface
{
$this->processBuilder->disableOutput();
return $this;
}