From a7e17cb70e9306f8887bd2b5ca1a37edcbe3ea0f Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Mon, 11 May 2015 15:02:33 +0200 Subject: Let composer manage its own files --- .../Component/Console/Output/StreamOutput.php | 103 --------------------- 1 file changed, 103 deletions(-) delete mode 100644 Aufgabe06/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php (limited to 'Aufgabe06/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php') diff --git a/Aufgabe06/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php b/Aufgabe06/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php deleted file mode 100644 index 8de10b4..0000000 --- a/Aufgabe06/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * StreamOutput writes the output to a given stream. - * - * Usage: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * - * As `StreamOutput` can use any stream, you can also use a file: - * - * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); - * - * @author Fabien Potencier - * - * @api - */ -class StreamOutput extends Output -{ - private $stream; - - /** - * Constructor. - * - * @param mixed $stream A stream resource - * @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) - * - * @throws \InvalidArgumentException When first argument is not a real stream - * - * @api - */ - public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) - { - if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) { - throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); - } - - $this->stream = $stream; - - if (null === $decorated) { - $decorated = $this->hasColorSupport(); - } - - parent::__construct($verbosity, $decorated, $formatter); - } - - /** - * Gets the stream attached to this StreamOutput instance. - * - * @return resource A stream resource - */ - public function getStream() - { - return $this->stream; - } - - /** - * {@inheritdoc} - */ - protected function doWrite($message, $newline) - { - if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) { - // should never happen - throw new \RuntimeException('Unable to write output.'); - } - - fflush($this->stream); - } - - /** - * Returns true if the stream supports colorization. - * - * Colorization is disabled if not supported by the stream: - * - * - Windows without Ansicon and ConEmu - * - non tty consoles - * - * @return bool true if the stream supports colorization, false otherwise - */ - protected function hasColorSupport() - { - if (DIRECTORY_SEPARATOR == '\\') { - return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); - } - - return function_exists('posix_isatty') && @posix_isatty($this->stream); - } -} -- cgit v1.2.3-70-g09d2