Outputs the string message in the console.

@param string       $string  The string message.
@param array|string $options The color options.
961535
protected function _write($string, $options = null)
    {
        $this->write($string, $options);
        $this->_counter++;

        if ($this->_counter % $this->_dotWidth === 0) {
            $counter = min($this->_counter, $this->_total);
            $percent = min(floor(($counter * 100) / $this->_total), 100) . '%';
            $this->write(str_pad($counter, strlen($this->_total) + 1, ' ', STR_PAD_LEFT));
            $this->write(' / ' . $this->_total);
            $this->write(' (' . str_pad($percent, 4, ' ', STR_PAD_LEFT) . ")\n");
        }
    }
896583
public static function log($message, $options = array())
    {
        if (array_key_exists('inputs', $options)) {
            $inputs = $options['inputs'];
        } else {
            $inputs = array(
                self::getTimestamp(),
                'LOG',
                self::getFilename(),
                self::getLineNumber()
            );
        }

        if (!array_key_exists('output', $options)) {
            $options['output'] = 'STDOUT';
        }

        if (array_key_exists('format', $options)) {
            array_unshift($inputs, $options['format']);
        } else {
            array_unshift($inputs, self::$format);
        }

        $inputs[] = $message;

        $logMessage = self::getLogMessage($inputs);
        if (array_key_exists('colour', $options) && !empty($options['colour'])) {
            self::out($logMessage, $options['colour'], $options['output']);
        } else {
            self::out($logMessage, false, $options['output']);
        }
    }
1352354
public function writeString($string) {

            $this->stream->writeInt(strlen($string));
            $this->stream->writeBuffer($string);

        }
997698
private function progress($string, $flags) {
		static $counter = 0;
		static $symbols = ["\\","|","/","-"];

		$this->output .= $string;
		
		if (false !== strpos($string, "\n")) {
			++$counter;
		}

		return $flags & PHP_OUTPUT_HANDLER_FINAL
			? "   \r"
			: sprintf("  %s\r", $symbols[$counter % 4]);
	}
1141255
private function labeledMessage($label, $message, $options = 0)
    {
        if (isset($this->stdErr)) {
            $this->stdErr->writeln('<options=reverse>' . strtoupper($label) . '</> ' . $message, $options);
        }
    }
96523
public function write($string) {
        if ( ! is_array($string)) {
            $string = [$string];
        }

        foreach ($string as $item) {
            $this->buffer .= $item;
        }
    }
1080206
public void setString(String string) {
        rawString = string;
        colorIndices.clear();
        // Search for color codes
        final StringBuilder stringBuilder = new StringBuilder(string);
        final Matcher matcher = COLOR_PATTERN.matcher(string);
        int removedCount = 0;
        while (matcher.find()) {
            final int index = matcher.start() - removedCount;
            // Ignore escaped color codes
            if (index > 0 && stringBuilder.charAt(index - 1) == '\\') {
                // Remove the escape character
                stringBuilder.deleteCharAt(index - 1);
                removedCount++;
                continue;
            }
            // Add the color for the index and delete it from the string
            final String colorCode = matcher.group();
            colorIndices.put(index, CausticUtil.fromPackedARGB(Long.decode(colorCode).intValue()));
            final int length = colorCode.length();
            stringBuilder.delete(index, index + length);
            removedCount += length;
        }
        // Color code free string
        this.string = stringBuilder.toString();
    }
1349025
protected function log_line($string) {

        if (!PHPUNIT_TEST) {
            mtrace($string);
        }
        if ($this->logfp) {
            fwrite($this->logfp, $string . "\n");
        }
    }
64560
private function parseOption($string)
    {
        $output = array();
        $exploded = explode(',', $string);

        $output['short'] = $exploded[0]; // short flag

        $regex = '/\[(.*)\]/';
        $output['long'] = $exploded[1];
        if (preg_match($regex, $exploded[1])) { // check for input
            $output['long'] = preg_replace($regex, '', $exploded[1]); // replace input from string
            $output['input'] = true; // set input as true
        }
        $output['long'] = trim($output['long']);

        return $output;
    }
1033306
public function writeLineIndented($string, $spaces = 2, $options = null) {
        return $this->writeLine($this->indent($string, $spaces), $options);
    }
547853
public static function colorize($string, $color)
    {
        if (isset(self::$colors[$color])) {
            return "\033[" . self::$colors[$color] . 'm' . $string . "\033[0m";
        }

        return $string;
    }
1278629
public function str($string, $foreground_color = null, $background_color = null) {
		$colored_string = "";
		if (isset($_SERVER['TERM']) && $_SERVER['TERM'] == 'xterm-256color') {
			// Check if given foreground color found
			if (isset($this->foreground_colors[ $foreground_color ])) {
				$colored_string .= "\033[" . $this->foreground_colors[ $foreground_color ] . "m";
			}
			// Check if given background color found
			if (isset($this->background_colors[ $background_color ])) {
				$colored_string .= "\033[" . $this->background_colors[ $background_color ] . "m";
			}

			// Add string and end coloring
			$colored_string .= $string . "\033[0m";
		} else {
			$colored_string = $string;
		}

		return $colored_string;
	}
545356
public function feedback( $string ) {
		if ( isset( $this->upgrader->strings[ $string ] ) ) {
			$string = $this->upgrader->strings[ $string ];
		}

		if ( false !== strpos( $string, '%' ) ) {
			$args = func_get_args();
			$args = array_splice( $args, 1 );
			if ( $args ) {
				$args   = array_map( 'strip_tags', $args );
				$args   = array_map( 'esc_html', $args );
				$string = vsprintf( $string, $args );
			}
		}
		if ( empty( $string ) ) {
			return;
		}

		$this->messages[] = $string;
	}
873793
public function getColoredString($string, $foregroundColor = null, $backgroundColor = null) {

        $colored_string = "";

        // Check if given foreground color found
        if (isset($this->foregroundColors[$foregroundColor])) {
            $colored_string .= "\033[" . $this->foregroundColors[$foregroundColor] . "m";
        }
        // Check if given background color found
        if (isset($this->backgroundColors[$backgroundColor])) {
            $colored_string .= "\033[" . $this->backgroundColors[$backgroundColor] . "m";
        }

        // Add string and end coloring
        $colored_string .=  $string . "\033[0m";

        return $colored_string;
    }
663097
public function alert($string)
    {
        $this->comment(str_repeat('*', strlen($string) + 12));
        $this->comment('*     ' . $string . '     *');
        $this->comment(str_repeat('*', strlen($string) + 12));

        $this->output->writeln('');
    }
607257
static public function
	Message($msg='',$opt=null) {
	/*//
	@argv string Message, object Options

	print a string to the terminal, automatically doing line wrapping. if the
	string has a prefix of white space, then that prefix will be appended
	to all the lines after line wrapping, all without breaking the specified
	width of the wrap.

	if prefix is Boolean True, then we will scoop off the prefix of whitespace
	from the beginning of the string and use it on each line that was wrapped.
	if was a string to start with, then we will just use that prefix.
	//*/

		$opt = new Nether\Object\Mapped($opt,[
			'EOL'    => PHP_EOL,
			'Prefix' => true,
			'Width'  => 75
		]);

		////////
		////////

		// scoop a prefix off the start of the string.
		if($opt->Prefix === true)
		$opt->Prefix = preg_replace('/^([\s]*).*?$/','\1',$msg);

		////////
		////////
		if($opt->Width) {
			// consider the prefix length.
			$opt->Width -= strlen($opt->Prefix);

			// wrap the text.
			$msg = wordwrap($msg,$opt->Width,$opt->EOL);
		}

		// apply the prefix.
		$lines = explode($opt->EOL,$msg);
		foreach($lines as $k => $v) $lines[$k] = sprintf(
			'%s%s',
			$opt->Prefix,
			ltrim($v)
		);

		echo implode($opt->EOL,$lines), $opt->EOL;
		return;
	}
563274
public function outputHtml($html, $options = array())
    {
        $this->addHeader('Content-Type', 'text/html; charset=utf-8')
            ->addOptionalHeaders($options)
            ->sendHeaders();

        echo $html;
        exit;
    }