1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10:
11:
12: namespace Symfony\Component\Console\Output;
13:
14: use Symfony\Component\Console\Formatter\OutputFormatter;
15: use Symfony\Component\Console\Formatter\OutputFormatterInterface;
16: use Symfony\Component\Console\Output\ConsoleOutputInterface;
17:
18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32:
33: class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
34: {
35: private $stderr;
36:
37: 38: 39: 40: 41: 42: 43: 44: 45: 46:
47: public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
48: {
49: parent::__construct(fopen('php://stdout', 'w'), $verbosity, $decorated, $formatter);
50: $this->stderr = new StreamOutput(fopen('php://stderr', 'w'), $verbosity, $decorated, $formatter);
51: }
52:
53: public function setDecorated($decorated)
54: {
55: parent::setDecorated($decorated);
56: $this->stderr->setDecorated($decorated);
57: }
58:
59: public function setFormatter(OutputFormatterInterface $formatter)
60: {
61: parent::setFormatter($formatter);
62: $this->stderr->setFormatter($formatter);
63: }
64:
65: public function setVerbosity($level)
66: {
67: parent::setVerbosity($level);
68: $this->stderr->setVerbosity($level);
69: }
70:
71: 72: 73:
74: public function getErrorOutput()
75: {
76: return $this->stderr;
77: }
78:
79: public function setErrorOutput(OutputInterface $error)
80: {
81: $this->stderr = $error;
82: }
83: }
84: