本文整理汇总了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;
}