Write a string to standard output

@param   string   $text  The text to display.
@param   boolean  $nl    True (default) to append a new line at the end of the output string.

@return  Stdout  Instance of $this to allow chaining.

@since   1.0
351712
public function out($text = '', $nl = true)
	{
		fwrite(STDOUT, $this->processor->process($text) . ($nl ? "\n" : null));

		return $this;
	}
488371
function _writeln($line)
    {
        /* Add this line to our output buffer. */
        $this->_buffer[] = $line;

        /* Buffer the output until this page's headers have been sent. */
        if (!headers_sent()) {
            return;
        }

        /* If we haven't already opened the output window, do so now. */
        if (!$this->_opened && !$this->open()) {
            return;
        }

        /* Drain the buffer to the output window. */
        $this->_drainBuffer();
    }
1214691
public function render(string $text): void
    {
        if ($this->overwrite) {
            if (!$this->firstRun) {

                // \x0D - Move the cursor to the beginning of the line
                // \x1B[2K - Erase the line
                $this->output->write("\x0D\x1B[2K", false);
                $this->output->write($text, false);
            }
        } elseif ($this->step > 0) {
            $this->output->write('');
        }

        $this->firstRun = false;
    }
1316461
public function write(&$text)
    {
        // All: Add the action if left empty
        if (preg_match_all('#<\s*form.*?action=""#im', $text, $matches, PREG_SET_ORDER)) {
            $view   = $this->getTemplate()->getView();
            $state  = $view->getModel()->getState();
            $action = $view->getRoute(http_build_query($state->getData($state->isUnique())));
            
            foreach ($matches as $match) {
                $str  = str_replace('action=""', 'action="'.$action.'"', $match[0]);
                $text = str_replace($match[0], $str, $text);
            }
        }
        
        // POST : Add token
        $matches = array();
        preg_match_all('/(<form.*method="post".*>)/i', $text, $matches, PREG_SET_ORDER);
       
        foreach ($matches as $match) {
            $input = PHP_EOL.'<input type="hidden" name="'.$this->_tokenName().'" value="'.$this->_tokenValue().'" />';
            $text = str_replace($match[0], $match[0].$input, $text, $count);
        }
       
        // GET : Add token to .-anahita-grid forms
        $matches = array();
        preg_match_all('#(<\s*?form\s+?.*?class=(?:\'|")[^\'"]*?-anahita-grid.*?(?:\'|").*?)#im', $text, $matches, PREG_SET_ORDER);
        
        foreach ($matches as $match) {
            $input = ' data-token-name="'.$this->_tokenName().'" data-token-value="'.$this->_tokenValue().'"';
            $text= str_replace($match[0], $match[0].$input, $text, $count);
        }
        
        // GET : Add query params
        $matches = array();
        if (preg_match_all('#<form.*action=".*\?(.*)".*method="get".*>#iU', $text, $matches)) {
            foreach ($matches[1] as $key => $query) {
                parse_str(str_replace('&amp;', '&', $query), $query);
                
                $input = $this->_renderQuery($query);
                $text  = str_replace($matches[0][$key], $matches[0][$key].$input, $text);
            }
        }
        
        return $this;
    }
692277
private static function apply($text, $color)
    {
        if (!array_key_exists($color, self::$outputFormatterStyles)) {
            self::$outputFormatterStyles[$color] = new OutputFormatterStyle($color);
        }

        return self::$outputFormatterStyles[$color]->apply($text);
    }
845977
private function writeLine($text, $indent = 0)
    {
        $indent = strlen($text) + $indent;
        $format = '%'.$indent.'s';

        $this->reference .= sprintf($format, $text).PHP_EOL;
    }
1107112
public static function stderr($text, $nl = true, $quit = -200): void
    {
        self::write($text, $nl, $quit, [
            'stream' => \STDERR,
        ]);
    }
799540
public function out($text = '', $nl = true)
	{
		if (!$this->getOption('q', 0))
		{
			parent::out($text, $nl);
		}

		return $this;
	}
543743
public function read(string $question = '', bool $nl = false): string
    {
        return Console::read($question, $nl);
    }
1282411
public function outputLine(string $text = '', array $arguments = []): void
    {
        $this->output($text . PHP_EOL, $arguments);
    }
320190
public static function readChar(string $message = '', bool $nl = false): string
    {
        $line = self::readln($message, $nl);

        return $line !== '' ? $line[0] : '';
    }
143316
public function write(&$text)
    {
        $matches = array();

        if (strpos($text, '<html')) {

            //add language
            $text = str_replace('<html', '<html lang="'.$this->getService('anahita:language')->getTag().'"', $text);

            //render the styles
            $text = str_replace('</head>', $this->_renderHead().$this->_renderStyles().'</head>', $text);

            //render the scripts
            $text = str_replace('</body>', $this->_renderScripts().'</body>', $text);
        }
    }
529955
public function writeln($messages = '', $newline = true, $quit = false)
    {
        if (\is_array($messages)) {
            $messages = \implode($newline ? PHP_EOL : '', $messages);
        }

        // 文字里面颜色标签翻译
        $messages = \style()->t((string)$messages);

        // 输出文字
        echo $messages;
        if ($newline) {
            echo "\n";
        }

        // 是否退出
        if ($quit) {
            exit;
        }
    }
611344
public function write($text, $option = [])
    {
        Output::write($this->format($text, $option));
        return $this;
    }
580946
def writeln(self, string='', *args, **kwargs):
        
        self.write(string + '\n', *args, **kwargs)
        self.on_new_line = True

        # If we're writing a block, increment indent for the next time
        if string and string[-1] == ':':
            self.current_indent += 1

        # Clear state after the user adds a new line
        self.auto_added_line = False
784747
public function err($text = '', $nl = true)
    {
        $this->output->err($text, $nl);

        return $this;
    }
637389
public function write($string)
    {
        $encodedLine = quoted_printable_encode($this->lastLine);
        $lineAndString = rtrim(quoted_printable_encode($this->lastLine . $string), "\r\n");
        $write = substr($lineAndString, strlen($encodedLine));
        $this->stream->write($write);
        $written = strlen($string);
        $this->position += $written;

        $lpos = strrpos($lineAndString, "\n");
        $lastLine = $lineAndString;
        if ($lpos !== false) {
            $lastLine = substr($lineAndString, $lpos + 1);
        }
        $this->lastLine = quoted_printable_decode($lastLine);
        return $written;
    }