本文整理匯總了PHP中Symfony\Component\Console\Output\OutputInterface::writeDebug方法的典型用法代碼示例。如果您正苦於以下問題:PHP OutputInterface::writeDebug方法的具體用法?PHP OutputInterface::writeDebug怎麽用?PHP OutputInterface::writeDebug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Console\Output\OutputInterface
的用法示例。
在下文中一共展示了OutputInterface::writeDebug方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: runTasks
protected function runTasks(InputInterface $input, OutputInterface $output)
{
$output->writeDebug("Starting Task Runner...");
$runner = new TaskRunner($this, $input, $output);
$runner->addTask(new InitialSetupTask());
$runner->addTask(new InitTask());
$runner->addTask(new ConfigDefaultsTask());
$runner->addTask(new ConfigSyncTask());
$runner->addTask(new PackagesTask());
$runner->addTask(new PhpTask());
$runner->addTask(new ProjectsInitTask());
$runner->addTask(new ProjectsProcessTask());
$runner->addTask(new ProjectsEndTask());
$runner->addTask(new ServiceRestartTask());
$runner->addTask(new ConfigDefaultsTask());
$runner->addTask(new ConfigSyncTask());
$runner->addTask(new EndTask());
$runner->run();
}
示例2: process
/**
* @param string $command
* @param OutputInterface $output
* @param array $options Process options, includes:
* bool logfile
* bool stderr
* bool stdout
* int timeout
* string input
* array env
* string cwd
* @return Process
*/
public static function process(OutputInterface $output, $command, array $options = [])
{
$options = array_merge(['stderr' => true, 'stdout' => $output->isDebug(), 'timeout' => 60, 'input' => null, 'env' => null, 'cwd' => null, 'logfile' => null], $options);
$output->writeDebug(str_repeat('-', 55));
$output->writeDebug("Executing command: {$command}");
$output->writeDebug(str_repeat('-', 55));
$process = new Process($command, $options['cwd'], $options['env'], $options['input'], $options['timeout']);
$process->run(function ($type, $buffer) use($output, $options) {
if ($type === Process::ERR) {
if ($options['stderr']) {
$output->writeStderr($buffer);
}
return;
}
if (!$options['stdout']) {
return;
}
$buffer = trim($buffer, "\n");
if (empty($buffer)) {
return;
}
$output->writeStdout($buffer);
});
$output->writeDebug(str_repeat('-', 55));
return $process;
}