read the current content of the file

@return string
162917
public function read()
    {

        // if file is readable
        if ($this->readable !== true) return false;

        if (!empty($this->fp) && is_resource($this->fp)) fclose($this->fp);

        $this->open_fp('r');

        if (filesize($this->file) == 0) return false;
        $this->lock(LOCK_SH);

        $content = (string)fread($this->fp, ($this->size >= 0) ? $this->size : 1);

        $this->lock(LOCK_UN);

        return $content;
    }
757316
public function getContent(): ?string {
        if (null !== $this->content) return $this->content;
        if (!$this->isFile()) return null;
        $content = \file_get_contents($this->path);
        if (false === $content) return null;
        return $content;
    }
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;
	}
1261920
public function getContent()
    {
        if ($this->content === null) {
            fseek($this->stream, 0);
            while (($buf = $this->read()) !== false) {
                $this->content .= $buf;
            }
        }

        return $this->content;
    }
1041239
public function current()
	{
		$doc = new DOMDocument();
		$object = simplexml_import_dom($doc->importNode($this->reader->expand(), true));
		return json_decode(json_encode($object));
	}
1059133
public function getContent()
    {
        if ($this->_content === null) {
            if (!$this->canRead()) {
                throw new Exception("Unable to read config file {$this->file}.");
            }
            
            $buffer = $this->getFileContent($this->file);
            $this->_content = $this->jsonDecode($buffer);
        }
        
        return $this->_content;
    }
141251
public function getContents()
    {
        if (!$this->isReadable()) {
            throw new \RuntimeException("Stream isn't readable");
        }
        
        $contents = '';
        
        while (!$this->eof()) {
            $contents .= $this->read(512000);
        }
        
        return $contents;
    }
1075642
private function readData()
    {
        switch ($this->fileType) {
            case self::TYPE_JSON :
                $data = json_decode(file_get_contents($this->readPath), true);
                break;
            default : $data = require $this->readPath;
        }
        return $data;
    }
147485
public function read()
    {
        $filename = $this->filename;
//        if (!$this->isFileWritable() && file_exists($this->getCacheFilename())) {
//            $filename = $this->getCacheFilename();
//        }

        $ret = Yaml::parse(file_get_contents($filename));
        if (false === $ret || array() === $ret) {
            throw new \InvalidArgumentException(sprintf('The %s file is not valid.', $filename));
        }

        if (count($ret)) {
            return $ret;
        } else {
            return array();
        }
    }
613707
protected function readByte()
    {
        if (feof($this->fileHandler)) {
            return false;
        }

        $data = unpack('C1byte', fread($this->fileHandler, 1));
        $this->currentByte = $data['byte'];
        $this->currentBitPosition = 0;

        return true;
    }
1014876
public function getContent() {

        $size = $this->getSize();

        if($size > 0) {

            $pos = $this->ftell();

            $this->fseek(0);
            $return = $this->fread($size);
            $this->fseek($pos);

            return $return;
        }

        return '';
    }
571323
protected function readStream()
    {
        if(!is_resource($this->stream)) {
            return '';
        }

        if(isset($headers['content-length'])) {
            $this->body = stream_get_contents($this->stream, $headers['content-length']);
        } else {
            $this->body = stream_get_contents($this->stream);
        }
        fclose($this->stream);
        $this->stream = null;
    }
1107371
public function read()
    {
        if ($this->data || !file_exists($this->filename)) {
            return $this->data;
        }

        return @unserialize(file_get_contents($this->filename)) ?: [];
    }
754426
public function read()
    {
        $lines = readLines($this->fileName, $this->fileEncoding);
        $fetch = array();

        foreach ($lines as $line) {
            $fields = preg_split('/\s+/', $line);
            if (count($fields) == 3) {
                array_push(
                    $fetch,
                    array('url' => $fields[0],
                          'length' => $fields[1],
                          'filename' => $fields[2])
                );
            }
        }
        $this->data = $fetch;
    }
267852
private function load()
    {
        if (! isset($this->runtime_file_content)) {
            $this->runtime_file_content = json_decode(@file_get_contents($this->getFilePath()), true);
        }

        return $this->runtime_file_content;
    }
675018
private function read()
    {
        $s = null;

        for (; !feof($this->sock);) {
            if (($line = fgets($this->sock, 1e3)) == null) {
                continue;
            }

            $s = explode(' ', $line)[0];

            if (preg_match('#^[0-9]+$#', $s)) {
                break;
            }
        }

        return (int) $s;
    }
986327
protected function readLine()
    {
        $buffer = '';

        while ($buffer === '') {
            if (($buffer = fgets($this->getFileHandler())) === false) {
                $this->currentLine = null;

                return;
            }
            $buffer = trim($buffer, "\n\r\0");

            if (!$this->skipEmptyLines) {
                break;
            }
        }

        $this->currentLine = $buffer;
    }