Logs a string in debug mode.

@param string $str the string to write

@return void
@private
198949
public static function log($str)
    {
        $indent_str = ".";


        if (!empty(self::$_PHPCAS_DEBUG['filename'])) {
            // Check if file exists and modifiy file permissions to be only
            // readable by the webserver
            if (!file_exists(self::$_PHPCAS_DEBUG['filename'])) {
                touch(self::$_PHPCAS_DEBUG['filename']);
                // Chmod will fail on windows
                @chmod(self::$_PHPCAS_DEBUG['filename'], 0600);
            }
            for ($i = 0; $i < self::$_PHPCAS_DEBUG['indent']; $i++) {

                $indent_str .= '|    ';
            }
            // allow for multiline output with proper identing. Usefull for
            // dumping cas answers etc.
            $str2 = str_replace("\n", "\n" . self::$_PHPCAS_DEBUG['unique_id'] . ' ' . $indent_str, $str);
            error_log(self::$_PHPCAS_DEBUG['unique_id'] . ' ' . $indent_str . $str2 . "\n", 3, self::$_PHPCAS_DEBUG['filename']);
        }

    }
858546
static void printToLogFile(String str) {
    try (BufferedWriter bw = new BufferedWriter(new FileWriter(getLogPath(), true))) {
      bw.write(str + logLineBreak);
    } catch (Throwable t) {
      showError(t);
    }
  }
1366252
private function evalString($str)
    {
        $a = false;

        if (class_exists('ParseError')) {
            try {
                $a = eval("return $str;");
            } catch (ParseError $e) {
            }
        } else {
            $a = @eval("return $str;");
        }

        return $a;
    }
817231
public function writeF($str, $args)
    {
        $args = func_get_args();
        if (count($args) < 2) {
            throw new \OutOfBoundsException('Missing argument #2');
        }

        return $this->write(vsprintf(array_shift($args), $args));
    }
1080430
public function fatal($str) {
        if ($this->_level >= self::FATAL) {
            //$this->put("[FATAL] $str".$this->backtrace(), $this->_wfName);
            //$this->put("[FATAL] [$str] ".$this->caller(), $this->_wfName);
            $this->put("$str ".$this->caller(), self::FATAL);
        }
    }
222149
public void debug(String s) {
        if (isEnabled() && isDebugEnabled()) {
            dispatchLogMessage(new LogEvent(this, LogEvent.DEBUG_TYPE, s));
        }
    }
1040943
public static function log($str="",$data=""){
		if (LogMaster::$_log){
			$message = $str.LogMaster::log_details($data)."\n\n";
			LogMaster::$session.=$message;
			error_log($message,3,LogMaster::$_log);			
		}
	}
336227
public static function trim(&$str='') {
		if (\is_array($str)) {
			foreach ($str as $k=>$v) {
				static::trim($str[$k]);
			}
		}
		else {
			cast::string($str, true);
			$str = \preg_replace('/(^\s+|\s+$)/u', '', $str);
		}
	}
205783
function _strlen($str) {
        static $mbstring;

        // Cache expensive function_exists() calls.
        if (!isset($mbstring)) {
            $mbstring = function_exists('mb_strwidth');
        }

        if ($mbstring) {
            return mb_strwidth($str, $this->_charset);
        }

        return strlen($str);
    }
6717
public function logDebug()
  {
    if ($this->getVerbosity()>=OutputInterface::VERBOSITY_DEBUG)
    {
      $args   = func_get_args();
      $format = array_shift($args);

      $this->writeln(vsprintf('<info>'.$format.'</info>', $args));
    }
  }
990161
public function logDebug($message, $attachment = null) {
        $this->messages[] = "debug: " . $message . print_r($attachment, true);
    }
359656
public function setDebug($debug)
    {
        $this->debug = strtolower((string) $debug);

        $message = sprintf("Set debug flag to [%s].", $this->debug);
        $this->log($message, Project::MSG_DEBUG);
    }
146693
function($str)
    {
        if (!this.hasFormatOptions)
        {
            this.addToLog($str);
            return false;
        }

        // strip colors from the string. this is ok with multilines
        if (this.options.stripColor)
        {
            $str = Utils.stripColor($str);
        }

        var $result = [];
        if (this.options.splitOnLinebreak)
        {
            var $split = Utils.splitOnLinebreak($str,
                                                this.options.trimLinebreak);

            for (var $i = 0, $iL = $split.length; $i < $iL; $i++)
            {
                $str = $split[$i];
                if (this.options.trimTimestamp)
                {
                    $str = Utils.trimTimestamp($str, !this.options.stripColor);
                }

                this.addToLog($str);
                $result.push($str);
            }
        }
        else
        {
            if (this.options.trimTimestamp)
            {
                $str = Utils.trimTimestamp($str, !this.options.stripColor);
            }

            if (this.options.trimLinebreak)
            {
                $str = Utils.trimLinebreak($str);
            }

            this.addToLog($str);
            $result.push($str);
        }

        return $result;
    }
888279
protected function parseTemplate($str)
    {
        $tag = '/{([\/$]?[-_:\w]*)}/';

        $input = preg_split($tag, $str, -1, PREG_SPLIT_DELIM_CAPTURE);

        $prefix = current($input);
        next($input);
        $this->template = [$prefix];

        $this->parseTemplateRecursive($input, $this->template);
    }
915957
private function _do($str)
    {
        $str = (string) $str;
        $strInt = (int) $str;
        $strFloat = (float) $str;
        if (
            !$str
            ||
            (string) $strInt === $str
            ||
            (string) $strFloat === $str
        ) {

            // no xss found
            if ($this->_xss_found !== true) {
                $this->_xss_found = false;
            }

            return $str;
        }

        // remove the BOM from UTF-8 / UTF-16 / UTF-32 strings
        $str = UTF8::remove_bom($str);

        // replace the diamond question mark (�) and invalid-UTF8 chars
        $str = UTF8::replace_diamond_question_mark($str, '');

        // replace invisible characters with one single space
        $str = UTF8::remove_invisible_characters($str, true, ' ');

        // normalize the whitespace
        $str = UTF8::normalize_whitespace($str);

        // decode UTF-7 characters
        $str = $this->_repack_utf7($str);

        // decode the string
        $str = $this->_decode_string($str);

        // remove all >= 4-Byte chars if needed
        if ($this->_stripe_4byte_chars) {
            $str = (string) \preg_replace('/[\x{10000}-\x{10FFFF}]/u', '', $str);
        }

        // backup the string (for later comparision)
        $str_backup = $str;

        // remove strings that are never allowed
        $str = $this->_do_never_allowed($str);

        // corrects words before the browser will do it
        $str = $this->_compact_exploded_javascript($str);

        // remove disallowed javascript calls in links, images etc.
        $str = $this->_remove_disallowed_javascript($str);

        // remove evil attributes such as style, onclick and xmlns
        $str = $this->_remove_evil_attributes($str);

        // sanitize naughty JavaScript elements
        $str = $this->_sanitize_naughty_javascript($str);

        // sanitize naughty HTML elements
        $str = $this->_sanitize_naughty_html($str);

        // final clean up
        //
        // -> This adds a bit of extra precaution in case something got through the above filters.
        $str = $this->_do_never_allowed_afterwards($str);

        // check for xss
        if ($this->_xss_found !== true) {
            $this->_xss_found = !($str_backup === $str);
        }

        return $str;
    }
318387
protected static function _highlight($str)
    {
        if (function_exists('hphp_log') || function_exists('hphp_gettid')) {
            return htmlentities($str);
        }
        $added = false;
        if (strpos($str, '<?php') === false) {
            $added = true;
            $str = "<?php \n" . $str;
        }
        $highlight = highlight_string($str, true);
        if ($added) {
            $highlight = str_replace(
                ['&lt;?php&nbsp;<br/>', '&lt;?php&nbsp;<br />'],
                '',
                $highlight
            );
        }

        return $highlight;
    }
1008629
public function out($str)
    {
        $str = Color::convert($str);
        if ($this->useAnsiColors() === false) {
            $str = Color::strip($str);
        }
        $this->getOutputter()->stdout($str, '');
        if (count(\ob_get_status()) !== 0) {
            ob_flush();
        }
    }