Write to the standard output device

@param string		$str
@return void
195002
public static function write( $str, $color = null, $background = null ) 
	{
		if ( !is_null( $color ) ) 
		{
			$str = static::color( $str, $color, $background );
		}
		
		fwrite( STDOUT, $str );
	}
201133
protected function write($str)
    {
        $file = $this->getLogPath() . $this->getFilename();
        $dir = \dirname($file);

        if (!is_dir($dir) && !@mkdir($dir, 0775, true)) {
            throw new FileSystemException("Create log directory failed. $dir");
        }

        // check file size
        if (is_file($file) && filesize($file) > $this->maxSize * 1000 * 1000) {
            rename($file, substr($file, 0, -3) . time() . '.log');
        }

        // return error_log($str, 3, $file);
        return file_put_contents($file, $str, FILE_APPEND);
    }
529048
@Override
    public void write(String str) {
		int len = str.length();
		for (int i = 0; i < len; i++) {
			append(str.charAt(i));
		}
    }
70586
public function write($str, $new_line = true)
    {
        fwrite($this->stream, $str.( true===$new_line ? PHP_EOL : '' ));
        fflush($this->stream);
    }
43752
public static function out(string $text, $out = STDOUT)
    {
        if (!isset($output)) {
            $output = function ($text) use ($out) {
                fwrite($out, $text);
            };
        }

        $text = str_replace("\n", PHP_EOL, $text);
        $text = Ansi::tagsToColors($text);
        fwrite($out, $text);
    }
1366330
public function writeAll($str)
    {
        if (substr($str, -1) == "\n") {
            $str = substr($str, 0, -1);
        }
        $this->write($str);
        $this->close('in');
        $this->debugStatus();

        return $this;
    }
1021009
public function writeString($str)
    {
        /**
         * This implementation supports only Basic Multilingual Plane
         * (BMP) characters (from 0x0000 to 0xFFFF) and doesn't support
         * "supplementary characters" (characters whose code points are
         * greater than 0xFFFF)
         * Java 2 represents these characters as a pair of char (16-bit)
         * values, the first from the high-surrogates range (0xD800-0xDBFF),
         * the second from the low-surrogates range (0xDC00-0xDFFF). Then
         * they are encoded as usual UTF-8 characters in six bytes.
         * Standard UTF-8 representation uses four bytes for supplementary
         * characters.
         */

        // convert input to a string before iterating string characters
        settype($str, 'string');

        $chars = $strlen = strlen($str);
        $containNullChars = false;

        for ($count = 0; $count < $strlen; $count++ ) {
            /**
             * String is already in Java 2 representation.
             * We should only calculate actual string length and replace
             * \x00 by \xC0\x80
             */
            if ((ord($str[$count]) & 0xC0) == 0xC0) {
                $addBytes = 1;
                if (ord($str[$count]) & 0x20 ) {
                    $addBytes++;

                    // Never used. Java2 doesn't encode strings in four bytes
                    // and we dont't support non-BMP characters
                    if (ord($str[$count]) & 0x10 ) {
                        $addBytes++;
                    }
                }
                $chars -= $addBytes;

                if (ord($str[$count]) == 0 ) {
                    $containNullChars = true;
                }
                $count += $addBytes;
            }
        }

        if ($chars < 0) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception('Invalid UTF-8 string');
        }

        $this->writeVInt($chars);
        if ($containNullChars) {
            $this->_fwrite(str_replace($str, "\x00", "\xC0\x80"));
        } else {
            $this->_fwrite($str);
        }
    }
821310
public function setStr($str)
    {
        if (!mb_check_encoding($str)) {
            throw new Exception('Name is not encoded in UTF-8');
        }
        $this->str = $str;
        $this->norm();

        return true;
    }
1016936
private function writeLine(string $str)
    {
        $now = time();
        if ($this->file && $this->file_opened < $now - $this->reopen_interval)
        {
            // Close the file after a set interval
            fclose($this->file);
            $this->file = null;
        }

        if (!$this->file)
        {
            touch($this->filename);
            try
            {
                Hook::execute("Wedeto.IO.FileCreated", ['path' => $this->filename]);
            }
            // @codeCoverageIgnoreStart
            // Ignore recursion: if and error occurs in a hook it may end up
            // calling the file writer again, resulting in a loop.
            catch (RecursionException $e)
            {} 
            // @codeCoverageIgnoreEnd


            $this->file = fopen($this->filename, 'a');
            $this->file_opened = time();
        }

        if ($this->file)
            fwrite($this->file, $str . "\n");
    }
216852
public function writeOutput($str)
    {
        if (empty($str)) {
            return $this;
        }

        $this->output[] = $str;

        if ($this->consoleOutput) {
            $this->consoleOutput->writeln($str);
        }

        return $this;
    }
195285
public static void write(String str, final OutputStream outputStream, Charset charset)
      throws IOException {
    new ByteSink() {
      @Override
      public OutputStream openStream() {
        return outputStream;
      }
    }.asCharSink(charset).write(str);
  }
130109
public function unserialize($str)
    {
        list(
            $this->class,
            $this->name,
            $this->queryParams,
            $this->requestParams,
            $this->default_start,
            $this->default_count,
            $this->max_count,
            $this->min_count,
            $this->param_converter_bag,
            $this->security
        ) = \unserialize($str);

        $this->reflection = new \ReflectionMethod($this->class, $this->name);
        $this->reflection->setAccessible(true);
    }
760326
private function write()
    {
        ftruncate($this->handle, 0);
        rewind($this->handle);

        fwrite($this->handle, serialize($this->data));
    }
1031836
public function dump($value, int $writer = Output::STANDARD): void
	{
		$this->getWriter($writer)->write(var_export($value, true) . PHP_EOL);
	}
837896
public function write(string $data) : void
    {
        $this->buffer .= $data;

        if (strlen($this->buffer) >= $this->size) {
            $this->flush();
        }
    }
910854
public function write_string($row, $col, $str, $format = null) {
        if (!isset($this->data[$row][$col])) {
            $this->data[$row][$col] = new MoodleODSCell();
        }
        if (is_array($format)) {
            $format = new MoodleODSFormat($format);
        }
        $this->data[$row][$col]->value = $str;
        $this->data[$row][$col]->type = 'string';
        $this->data[$row][$col]->format = $format;
        $this->data[$row][$col]->formula = null;
    }
1143555
protected function write($string, $token)
    {
        if ($this->stream === null) {
            echo $string;
        } else {
            $callback = $this->stream;
            $callback($string, $token);
        }

        $this->bytes += strlen($string);
    }