*/ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface { private $stderr; private $consoleSectionOutputs = []; /** * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ public function __construct( int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null, ) { parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); if (null === $formatter) { // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); return; } $actualDecorated = $this->isDecorated(); $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); if (null === $decorated) { $this->setDecorated($actualDecorated && $this->stderr->isDecorated()); } } /** * Creates a new output section. */ public function section(): ConsoleSectionOutput { return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); } /** * {@inheritdoc} */ public function setDecorated(bool $decorated) { parent::setDecorated($decorated); $this->stderr->setDecorated($decorated); } /** * {@inheritdoc} */ public function setFormatter(OutputFormatterInterface $formatter) { parent::setFormatter($formatter); $this->stderr->setFormatter($formatter); } /** * {@inheritdoc} */ public function setVerbosity(int $level) { parent::setVerbosity($level); $this->stderr->setVerbosity($level); } /** * {@inheritdoc} */ public function getErrorOutput() { return $this->stderr; } /** * {@inheritdoc} */ public function setErrorOutput(OutputInterface $error) { $this->stderr = $error; } /** * Returns true if current environment supports writing console output to * STDOUT. * * @return bool */ protected function hasStdoutSupport() { return false === $this->isRunningOS400(); } /** * Returns true if current environment supports writing console output to * STDERR. * * @return bool */ protected function hasStderrSupport() { return false === $this->isRunningOS400(); } /** * Checks if current executing environment is IBM iSeries (OS400), which * doesn't properly convert character-encodings between ASCII to EBCDIC. */ private function isRunningOS400(): bool { $checks = [ \function_exists('php_uname') ? php_uname('s') : '', getenv('OSTYPE'), \PHP_OS, ]; return false !== stripos(implode(';', $checks), 'OS400'); } /** * @return resource */ private function openOutputStream() { if (!$this->hasStdoutSupport()) { return fopen('php://output', 'w'); } // Use STDOUT when possible to prevent from opening too many file descriptors return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w')); } /** * @return resource */ private function openErrorStream() { if (!$this->hasStderrSupport()) { return fopen('php://output', 'w'); } // Use STDERR when possible to prevent from opening too many file descriptors return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w')); } } __halt_compiler();----SIGNATURE:----YIf6biz1vF8x/FRBElnB+nlbJXHpDXoGNW8G0ttczTKhvZPN8kJU9XARNi84hMVtmFmFHtK2nOUd5cCcSufoBwsozqTrOec6oeNJUManE1GT80hRYNMgdnNbr37FJ65mk2n8jGWq+2SLjgQ5SmOm0iu1MzwSWH4tBntdJ5InS45PiTnwfqkz5QMnoa/VtrbxKSCP54VsWKiMsASmHV6WCD1kkyhSq0pupn5Ne0fyCn69rgaqNMBE0jb9FInmcCZsOug59/nBbqAom+rY6vaUgTYKz6XuE5nNR/lUwhF614/+uUL/6+w5SJTSNxKDHcxqbTjXxNlFr+s4GQQm8MQF6e+26+Hrqj9PFE8A5ZPbgbxUNXN1KgNuH7p+ekqMen8D47E72xCisqbvWkBrTByMKXb3DmYM63Nlo504N8fQjR6Gl5xFiLtbrpNhVwPmTytY216+6hrbXx+CieIks3KMs2KbDOpu2iMoa7dFX4SAcL+DUVntRSuIPPDH/Ylum9CbcOviDxHLBraPWciQKnHxjoogi7jdqwzfIyphjoOkmPgGJoSyxYkUaiFa1j7BAGuEfG9CrboYBlubm/8SHvPlH52GIKcXo5UTsmyNIsVgg/NmZxg7/nehwO9RLYj98FWNHMG9y8pyy96Lbdowj0Cqr9ZsgNxzf0UlA7tVAgLMLJk=----ATTACHMENT:----NzQwODQ0NTAyMzEwNzg3NCAzMjgxMDM2NTcxODcxMTA4IDIxMjkxOTU4MTcxNzM0NjU=