Writes  message(s) at start of the output console.

@param string|array $messages message or array of messages
486127
public function writeBeginning($messages = array())
    {
        //Write it for each message = each renderer
        foreach ($messages as $key => $message) {
            $file = $this->outputPath.DIRECTORY_SEPARATOR.$this->rendererFiles[$key].'.html';
            $fileContents = file_get_contents($file);
            file_put_contents($file, $message.$fileContents);
        }
    }
92834
protected function addMessages($method, array $messages)
    {
        // If there was exactly 1 message, it wasn't put in an array of messages.
        if (array_key_exists('code', $messages)) {
            $messages = array($messages);
        }
        foreach ($messages as $message) {
            call_user_func(array($this, $method), $message);
        }
        return $this;
    }
552405
public function write($messages = array())
    {
        //Write it for each message = each renderer
        foreach ($messages as $key => $message) {
            $file = $this->outputPath.DIRECTORY_SEPARATOR.$this->rendererFiles[$key].'.html';
            file_put_contents($file, $message);
            $this->copyAssets($key);
        }
    }
1023233
public static function write($message = null, $padding = null)
    {
        if ($padding > 0) {
            $message = str_pad($message, $padding, ' ');
        }

        self::stdOut($message);
    }
1191940
public function render($messages = null)
	{
		if ($messages)
		{
			$this->setMessages($messages);
		}

		$messages = $this->getMessages();

		$output = array();
		$output[] = '<script type="text/javascript">';
		$output[] = 'if (!window.console) console = {};';
		$output[] = 'console.log   = console.log   || function(){};';
		$output[] = 'console.warn  = console.warn  || function(){};';
		$output[] = 'console.error = console.error || function(){};';
		$output[] = 'console.info  = console.info  || function(){};';
		$output[] = 'console.debug = console.debug || function(){};';
		foreach ($messages as $item)
		{
			$output[] = 'console.' . $item['label'] . '("' . addslashes($this->_deflate($item['message'])) . '");';
		}
		$output[] = '</script>';
		return implode("\n", $output);
	}
1343136
public function write_message($message)
  {
    $binary_length = strlen($message);
    
    $max_binary_frame_length = BUFFER_SIZE - 4;
    $sended_length = 0;
    
    $frames = array();
    while ($sended_length < $binary_length) {
      $not_sended_length = $binary_length - $sended_length;
      $binary_frame_length = ($not_sended_length > $max_binary_frame_length) ? $max_binary_frame_length : $not_sended_length;
      $frames[] = substr($message, $sended_length, $binary_frame_length);
      $sended_length += $binary_frame_length;
    }
    
    $header = pack("N", self::$serial++).pack("N", count($frames));
    //socket_send ($this->socket, $header, strlen($header) , 0);
    $x = socket_write ($this->socket, $header, strlen($header));
    foreach ($frames as $frame) {
      $msg = pack("N", strlen($frame)).$frame;
      socket_write ( $this->socket, $msg, strlen($msg));
    }
    
  }
1232898
protected function _log($messages)
    {
        if (!is_array($messages)) {
            $messages = [$messages];
        }
        foreach ($messages as $message) {
            file_put_contents(static::$logFile, date('d.m.Y H:i:s') . ' - ' . $message . PHP_EOL, FILE_APPEND | LOCK_EX);
        }
    }
64937
public function messagePrintf(array $args = array())
    {
        $this->raw_msg = vsprintf($this->raw_msg, $args);
        $this->message = vsprintf($this->message, $args);
    }
486564
public function writeln($messages = array())
    {
        //Write it for each message = each renderer
        foreach ($messages as $key => $message) {
            $file = $this->outputPath.DIRECTORY_SEPARATOR.$this->rendererFiles[$key].'.html';
            file_put_contents($file, $message, FILE_APPEND);
        }
    }
194334
protected function sendMessage(Message $message) {
		if(!$this->isIgnored($message)) {
			parent::sendMessage($message);
			$this->sentMessages[] = $message;
		}
	}
854621
public function writeInfo( $s )
	{
		$message = $this->cleanMessage( $s );

		if ( ! empty( $message ) )
		{
			$this->bag[] = array( self::INFO , $message );
		}
	}
689505
public function write($messages, $options = 0)
    {
        $this->log($messages);
        $this->output->write($messages, false, $options);
    }
1069376
public function logMessage(Message $message) {
        foreach($this->logger as $logger) {
            $logger->logMessage($message);
        }
    }
267316
private function overwrite(string $message): void
    {
        if ($this->overwrite) {
            if (!$this->firstRun) {
                if ($this->output instanceof ConsoleSectionOutput) {
                    $lines = floor(Helper::strlen($message) / $this->terminal->getWidth()) + $this->formatLineCount + 1;
                    $this->output->clear($lines);
                } else {
                    // Erase previous lines
                    if ($this->formatLineCount > 0) {
                        $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message;
                    }

                    // Move the cursor to the beginning of the line and erase the line
                    $message = "\x0D\x1B[2K$message";
                }
            }
        } elseif ($this->step > 0) {
            $message = PHP_EOL.$message;
        }

        $this->firstRun = false;

        $this->output->write($message);
    }
1157139
protected function log($message)
    {

        if ($this->debug == true) {
            file_put_contents("php://stdout", $message . "\n");
        }

        file_put_contents($this->dump_dir . 'dump.log', $message . "\n", \FILE_APPEND);
    }
399310
protected function writeSection(array $messages, string $style = 'bg=blue;fg=white'): void
    {
        $this->output->writeln(
            [
                '',
                $this->getHelper('formatter')->formatBlock($messages, $style, true),
                '',
            ]
        );
    }
423654
protected function write($messages, $file)
    {
        $f = @fopen($file, 'a');
        if ($f === false)
        {
            throw new \Exception("Logfile $file is not writeable!");
        }

        foreach($messages as $msg)
        {
            fwrite($f, $msg);
        }

        fclose($f);
    }