2019-01-19 14:40:52 +00:00
|
|
|
<?php
|
|
|
|
|
2019-01-19 14:54:24 +00:00
|
|
|
namespace OCA\OCCWeb\Controller;
|
2019-01-19 14:40:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
use Symfony\Component\Console\Output\BufferedOutput;
|
|
|
|
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
2020-01-26 14:37:16 +00:00
|
|
|
use Symfony\Component\Console\Output\ConsoleSectionOutput;
|
2019-01-19 14:40:52 +00:00
|
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
|
2020-01-30 21:04:23 +00:00
|
|
|
|
2019-01-19 16:20:07 +00:00
|
|
|
class OccOutput extends BufferedOutput implements ConsoleOutputInterface
|
2019-01-19 14:40:52 +00:00
|
|
|
{
|
2020-01-30 21:04:23 +00:00
|
|
|
private $consoleSectionOutputs = [];
|
2019-01-19 14:40:52 +00:00
|
|
|
|
2020-01-30 21:04:23 +00:00
|
|
|
private $stream;
|
2019-01-19 14:40:52 +00:00
|
|
|
/**
|
|
|
|
* Gets the OutputInterface for errors.
|
|
|
|
*
|
|
|
|
* @return OutputInterface
|
|
|
|
*/
|
|
|
|
public function getErrorOutput()
|
|
|
|
{
|
|
|
|
// TODO: Implement getErrorOutput() method.
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setErrorOutput(OutputInterface $error)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2020-01-26 14:37:16 +00:00
|
|
|
|
2020-01-30 21:04:23 +00:00
|
|
|
/**
|
|
|
|
* Creates a new output section.
|
|
|
|
*/
|
|
|
|
public function section(): ConsoleSectionOutput {
|
|
|
|
if ($this->stream === null) {
|
|
|
|
$this->stream = fopen('php://temp','w');
|
|
|
|
}
|
|
|
|
return new ConsoleSectionOutput($this->stream, $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter());
|
|
|
|
}
|
|
|
|
|
2019-01-19 14:40:52 +00:00
|
|
|
}
|