Return the file content of the given file

@param  string $file File complete path
@return string File content (or false if problem)
19366
protected function _fileGetContents($file)
    {
        $result = false;
        if (!is_file($file)) {
            return false;
        }
        $f = @fopen($file, 'rb');
        if ($f) {
            if ($this->_options['file_locking']) @flock($f, LOCK_SH);
            $result = stream_get_contents($f);
            if ($this->_options['file_locking']) @flock($f, LOCK_UN);
            @fclose($f);
        }
        return $result;
    }
506375
public function getFile(string $key, string $file) : string
    {
        return $this->getDirectory($key) . '/' . $file;
    }
616419
public static function get(
        $file
    ) {
        if (is_string($file)) {
            $file = new \SplFileInfo($file);
        }

        $extension = mb_strtolower($file->getExtension());
        if ('' === $extension) {
            return static::MIME_TYPE_IF_UNKNOWN;
        }

        if (array_key_exists($extension, static::$mimeTypes)) {
            return static::$mimeTypes[$extension];
        }

        if (function_exists('finfo_open') && $file->isFile()) {
            $path = $file->getPath();

            $fileInfo = finfo_open(FILEINFO_MIME);
            $mimeType = finfo_file($fileInfo, $path);
            finfo_close($fileInfo);

            return $mimeType;
        }

        return static::MIME_TYPE_IF_UNKNOWN;
    }
11928
public function get($file)
    {
        $basepath = $this->config['basepath'];
        $suffix = $this->config['suffix'];
        $target = "$basepath/$file{$suffix}";

        if (!is_readable($target)) {
            throw new \Exception(t("No such file content: @FILENAME", ["@FILENAME" => $target]));
        }

        $filter  = $this->config['textfilter'];
        $content = file_get_contents($target);
        $content = $this->di->textFilter->doFilter($content, $filter);

        return $content;
    }
188448
public static function getContent($file)
    {
        if (!File::exists($file)) {
            throw new IOException(sprintf("File %s does not exist", $file));
        }

        $content = file_get_contents($file);

        if (false === $content) {
            throw new IOException(sprintf("Cannot get content from file %s", $file));
        }

        return $content;
    }
196243
public function getContent($file)
    {
        $this->fileInfo = GeneralUtility::makeInstance(Fileinfo::class);
        $this->fileInfo->setFile($file);

        // get PDF informations
        if (!$pdfInfo = $this->getPdfInfo($file)) {
            return false;
        }

        // proceed only of there are any pages found
        if ((int)$pdfInfo['pages'] && $this->isAppArraySet) {
            // create the tempfile which will contain the content
            $tempFileName = GeneralUtility::tempnam('pdf_files-Indexer');

            // Delete if exists, just to be safe.
            @unlink($tempFileName);

            // generate and execute the pdftotext commandline tool
            $fileEscaped = CommandUtility::escapeShellArgument($file);
            $cmd = "{$this->app['pdftotext']} -enc UTF-8 -q $fileEscaped $tempFileName";

            CommandUtility::exec($cmd);

            // check if the tempFile was successfully created
            if (@is_file($tempFileName)) {
                $content = GeneralUtility::getUrl($tempFileName);
                unlink($tempFileName);
            } else {
                $errorMessage = 'Content for file ' . $file . ' could not be extracted. Maybe it is encrypted?';
                $this->pObj->logger->warning($errorMessage);
                $this->addError($errorMessage);

                // return empty string if no content was found
                $content = '';
            }

            return $this->removeEndJunk($content);
        } else {
            return false;
        }
    }
119324
protected function get_file( $file ) {

		$path_parts = $this->parse_path( $file );

		if ( '' === $path_parts[0] ) {
			$file = $this->root;
			unset( $path_parts[0] );
		} else {
			$file = $this->cwd;
		}

		foreach ( $path_parts as $part ) {

			if ( '' === $part ) {
				continue;
			}

			if ( 'dir' !== $file->type || false === isset( $file->contents->$part ) ) {
				return false;
			}

			$file = $file->contents->$part;
		}

		return $file;
	}
615775
protected function getFilePath($file)
    {
        // if were passed an instance of UploadedFile, return the path
        if ($file instanceof UploadedFile) {
            return $file->getPathname();
        }

        // if we're passed a PHP file upload array, return the "tmp_name"
        if (is_array($file) && null !== array_get($file, 'tmp_name')) {
            return $file['tmp_name'];
        }

        // fallback: we were likely passed a path already
        return $file;
    }
217807
public function getFilePath($file): string
    {
        if (null === ($fileObj = $this->container->get('huh.utils.file')->getFileFromUuid($file))) {
            return '';
        }

        return $fileObj->path;
    }
368707
protected function Read($file)
    {
        # Open File
        $fh = fopen($file, 'r');
        $fileSize = filesize($file);
        
        if(!empty($fileSize)) {
            # Read Data
            $data = fread($fh, $fileSize);
            
            # Fix Data Stream to be the exact same format as PHP's strings
            $data = str_replace(array("\r\n", "\r", "\n"), "\n", $data);
        } else {
            $data = '';
        }
        
        # Close File
        fclose($fh);
        
        # Return Data
        return $data;
    }
67556
public function getFileFromZip($file)
    {
        if (false !== $content = $this->zip->getFromName($file)) {
            $tmpDir = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
            $fileName = $tmpDir . md5($file) . time() . '.' . pathinfo($file, PATHINFO_EXTENSION);
            file_put_contents($fileName, $content);

            $this->destructible[] = $fileName;

            return $fileName;
        }

        return null;
    }
1105728
protected function getFileContents($file)
    {
        // If the file is not readable
        if (!is_readable($file)) {
            throw new RuntimeException(
                sprintf(RuntimeException::INVALID_FILE_STR, $file),
                RuntimeException::INVALID_FILE
            );
        }

        return file_get_contents($file);
    }
776877
public function file($file)
    {
        $filePaths = loader()->getPublicDirs(true);

        foreach ($filePaths as $filePath) {
            if (is_file($filePath . $file)) {
                return path_to_url($filePath . $file);
                break;
            }
        }
    }
1338519
protected function findFile($file)
    {
        foreach (clone $this->paths as $path) {
            $filePath = $path . '/' . $file;

            if (is_file($filePath)) {
                return $filePath;
            }
        }

        return false;
    }
972050
protected function getFileContents($file, $line){
        if(!is_string($file) || !is_int($line)
            || !is_file($file) || !is_readable($file)
        ){
            return null;
        }

        $file       = new \SplFileObject($file, "r");
        $current    = 1;
        $contents   = [];
        $min        = $line - 3;
        $max        = $line + 3;

        foreach($file as $row){
            if($min <= $current && $current <= $max){
                $contents[$current] = $row;
            }

            $current++;
        }

        if(empty($contents)){
            return null;
        }

        return $contents;
    }
1242234
public function getFileIcon($file = '')
    {
        $extension = File::extension($file);

        foreach ($this->fileTypes as $type => $regex) {
            if (preg_match("/^($regex)$/i", $extension) !== 0) {
                return "fa-file-{$type}-o";
            }
        }

        return 'fa-file-o';
    }
240175
private function getFileContents($files)
	{
		$content = '';
		$basePath = $this->basePath;

		array_walk($files,function(&$value, $key) use(&$content, $basePath){
			if(file_exists($basePath.$value))
			$content .= file_get_contents($basePath.$value);
		});
		return $content;
	}