Get the file contents stripping all lines beginning by a sharp `#`
@return string
499958
public function getWDBContent()
    {
        $contents = array();
        foreach ($this as $line) {
            if (!empty($line) && $line!=="\n" && $line{0}!='#') {
                $contents[] = $line;
            }
        }
        return implode('', $contents);
    }
1147629
public function getRouteDefinitions()
    {
        $output = '';

        foreach ($this->getEndpointsInClasses($this->getReader()) as $endpoint) {
            $output .= $endpoint->toRouteDefinition().PHP_EOL.PHP_EOL;
        }

        return trim($output);
    }
475133
public function getCode(): string
  {
    $lines       = [];
    $indentLevel = 0;

    foreach ($this->lines as $line)
    {
      $mode = $this->indentationMode($line);

      // Increment or decrement indentation level.
      if ($mode & self::C_INDENT_INCREMENT_BEFORE)
      {
        $indentLevel++;
      }
      if ($mode & self::C_INDENT_DECREMENT_BEFORE)
      {
        $indentLevel = max(0, $indentLevel - 1);
      }
      if ($mode & self::C_INDENT_DECREMENT_BEFORE_DOUBLE)
      {
        $indentLevel = max(0, $indentLevel - 2);
      }

      // If the line is a separator shorten the separator.
      if ($this->separator!==null && $line==$this->separator)
      {
        $line = $this->shortenSeparator($this->width - $this->indentation * $indentLevel);
      }

      // Append the line with indentation.
      $lines[] = $this->addIndentation($line, $indentLevel);

      // Increment or decrement indentation level.
      if ($mode & self::C_INDENT_INCREMENT_AFTER)
      {
        $indentLevel++;
      }
      if ($mode & self::C_INDENT_DECREMENT_AFTER)
      {
        $indentLevel = max(0, $indentLevel - 1);
      }
    }

    if (empty($lines))
    {
      return '';
    }

    return implode(PHP_EOL, $lines).PHP_EOL;
  }
341243
public function asString()
    {
        $tmp = new \SplTempFileObject;

        foreach ($this->data as $row) {
            $tmp->fputcsv($row, $this->delimiter);

            if ($this->lineEnding !== "\n") {
                $tmp->fseek(-1, \SEEK_CUR);
                $tmp->fwrite($this->lineEnding);
            }
        }

        # Find out how much data we have written
        $length = $tmp->ftell();
        if ($length < 1) {
            return "";
        }

        # Reset the internal pointer and return all the data we have written
        $tmp->fseek(0);
        return $tmp->fread($length);
    }
99950
protected function getLines()
    {
        $ret = file($this->fileName);
        if ($ret === false) {
            throw new Exception('Unable to read file');
        }
        $lines = array();
        foreach ($ret as $line) {
            $lines[] = rtrim($line);
        }

        return $lines;
    }
632128
public function getFisrt() : string
        {
                $value = $this->_redis->lpop($this->_key);
                return !empty($value)?$value:'';
        }
468548
public function toString()
    {
        ob_start();

        printf(
            "%s:\n\nMessage:\n\t%s\n\n" . "In file '%s' on line %s.\n\n",
            $this->getSeverityString(),
            $this->message,
            $this->file,
            $this->line
        );

        echo "Stack Trace:\n";
        $count = count($this->backtrace);

        foreach ($this->backtrace as $entry) {
            $class = array_key_exists('class', $entry) ? $entry['class'] : null;

            $function = array_key_exists('function', $entry)
                ? $entry['function']
                : null;

            if (array_key_exists('args', $entry)) {
                $arguments = $this->getArguments(
                    $entry['args'],
                    $function,
                    $class
                );
            } else {
                $arguments = '';
            }

            printf(
                "%s. In file '%s' on line %s.\n%sMethod: %s%s%s(%s)\n",
                str_pad(--$count, 6, ' ', STR_PAD_LEFT),
                array_key_exists('file', $entry) ? $entry['file'] : 'unknown',
                array_key_exists('line', $entry) ? $entry['line'] : 'unknown',
                str_repeat(' ', 8),
                $class === null ? '' : $class,
                array_key_exists('type', $entry) ? $entry['type'] : '',
                $function === null ? '' : $function,
                $arguments
            );
        }

        echo "\n";

        return ob_get_clean();
    }
110945
public function current() {
		if ($this->string === null) {
			$this->string = fgets($this->file);
		}
		
		$string = rtrim($this->string, "\n\r");
		
		if ($this->delimiter === null) {
			return $string;
		} 
		
		$dataRaw = explode($this->delimiter, $string);
		$data    = [];

		if ($this->partsNames === null) {
			foreach ($dataRaw as $key => $part) {
				$data[self::UNNAMED_PREFIX . $key] = $part;
			}
			
			return $data;
		}
		
		foreach ($dataRaw as $key => $part) {
			if (isset($this->partsNames[$key])) {
				$data[$this->partsNames[$key]] = $part;
				continue;
			}
			
			$data[self::UNNAMED_PREFIX . $key] = $part;
		}

		return $data;
	}
1182080
public function getTraceAsString()
    {
        $remove = "Stack trace:\n";
        $len = strpos($this->_toString, $remove);
        if ($len === false) {
            return '';
        }
        return substr($this->_toString, $len + strlen($remove));
    }
814813
protected function getIncludeFileContent(): string
    {
        $includeFileTemplate = $this->filesystem->normalizePath(__DIR__ . '/../' . self::INCLUDE_FILE_TEMPLATE);
        $includeFileContent = file_get_contents($includeFileTemplate);
        foreach ($this->tokens as $token) {
            $includeFileContent = self::replaceToken($token->getName(), $token->getContent(), $includeFileContent);
        }
        return $includeFileContent;
    }
697707
public static function sep()
    {
        if (static::$sep !== null) {
            return static::$sep;
        }

        if (defined('PHP_EOL')) {
            static::$sep = PHP_EOL;
        } else {
            static::$sep = (strpos(PHP_OS, 'WIN') === false) ? '\n' : '\r\n';
        }

        return static::$sep;
    }
649544
protected static function _line($trace)
    {
        $path = $trace['file'];
        $callLine = $trace['line'];
        if (!file_exists($path)) {
            return;
        }
        $file = file_get_contents($path);
        if (($i = static::_findPos($file, $callLine)) === null) {
            return;
        }
        $line = $callLine;

        $brackets = 0;
        while ($i >= 0) {
            if ($file[$i] === ')') {
                $brackets--;
            } elseif ($file[$i] === '(') {
                $brackets++;
            } elseif ($file[$i] === "\n") {
                $line--;
            }
            if ($brackets > 0) {
                return $line;
            }
            $i--;
        }
    }
184545
public function Content()
    {
        $content = $this->owner->Content;

        // Internal links.
        $matches = array();
        preg_match_all('/<a.*href="\[file_link,id=([0-9]+)\].*".*>.*<\/a>/U', $content, $matches);

        for ($i = 0; $i < count($matches[0]); $i++) {
            $file = DataObject::get_by_id('File', $matches[1][$i]);
            if ($file) {
                $size     = $file->getSize();
                $ext     = strtoupper($file->getExtension());
                $newLink = $matches[0][$i] . "<span class='fileExt'> [$ext, $size]</span>";
                $content = str_replace($matches[0][$i], $newLink, $content);
            }
        }

        // and now external links
        $pattern     = '/<a href=\"(h[^\"]*)\">(.*)<\/a>/iU';
        $replacement = '<a href="$1" class="external">$2</a>';
        $result         = preg_replace($pattern, $replacement, $content, -1);
        return $result;
    }
1064947
public function getHeadSHA1() {
		$headFile = "{$this->dir}/HEAD";
		if ( !is_readable( $headFile ) ) {
			return false;
		}

		$head = file_get_contents( $headFile );
		if ( preg_match( "/ref: (.*)/", $head, $m ) ) {
			$head = rtrim( $m[1] );
		} else {
			$head = rtrim( $head );
		}

		if ( self::isSHA1( $head ) ) {
			// Detached head
			return $head;
		}

		// Resolve ref
		$refFile = "{$this->dir}/{$head}";
		if ( !is_readable( $refFile ) ) {
			return false;
		}

		return rtrim( file_get_contents( $refFile ) );
	}
1260171
public function getDescription()
    {
        $reflectionClass = new \ReflectionClass($this);
        $lines = explode(chr(10), $reflectionClass->getDocComment());
        foreach ($lines as $line) {
            $line = trim($line);
            if ($line === '' || $line === '/**' || $line === '*' || $line === '*/' || strpos($line, '* @') !== false) {
                continue;
            }
            return preg_replace('/\s*\\/?[\\\\*]*\s?(.*)$/', '$1', $line);
        }
    }
1334872
public function getTail($lines = 10){
		$this->blockStart = $this->fileSize;
		$buff1 = Array();
		$lastLines = array();
		
		while($this->blockStart){
			$buff = $this->readChunk();
			if(!$buff)break;
			
			$lines -= substr_count($buff, "\n");
			
			if($lines <= 0)
			{
				$buff1[] = $this->cutHead($buff, "\n", abs($lines)+1);
				break;
			}
			$buff1[] = $buff;
		}
		
		for($i = count($buff1); $i >= 0; $i--){
			$lastLines = array_merge($lastLines, explode("\n", $buff1[$i]));
		}
		
		return $lastLines;
	}
608604
private static function _load_file() {
		$t_array = file( __DIR__ . '/../../data/domains.txt' );
		$t_result_array = array();

		foreach ( $t_array as $t_line ) {
			$t_entry = trim( $t_line );
			if ( empty( $t_entry ) ) {
				continue;
			}

			# Exclude commented lines
			if ( strpos( $t_entry, '#' ) === 0 ) {
				continue;
			}

			$t_domain = strtolower( $t_entry );
			$t_result_array[$t_domain] = true;
		}

		return $t_result_array;
	}