To get file content

@param string $filename

@return string
@throws FileNotFoundException
354525
public function get($filename)
    {
        if ($this->exists($filename) && $this->isFile($filename)) {
            return file_get_contents($filename);
        }

        throw new FileNotFoundException('File not found in the path [ ' . $filename . ' ].');
    }
787419
public static function fromFile($filename)
    {
        $records = Collection::fromFile($filename)->toArray();

        if (!count($records)) {
            throw new RecordNotFound();
        }

        return $records[0];
    }
501152
public function fileGet($file)
    {
        if (($r = @file_get_contents($this->alias->resolve($file))) === false) {
            throw new FileNotFoundException($file);
        }

        return $r;
    }
9337
public function getFileByName($filename)
    {
        $files = $this->getFiles();
        foreach ($files as $file) {
            if ($filename == $file->file) {
                return $file;
            }
        }

        return null;
    }
165666
protected function readData($fileName)
    {
        $client   = new Client([ 'defaults' => [ 'timeout' => $this->getConfiguration()->getTimeout() ] ]);
        $response = $client->get($fileName);

        return $response->getBody();
    }
1345484
public function getFile($filename) {

        $filename = realpath(__DIR__.'/../headers/'.$filename.'.txt');

        if(!file_exists($filename)) throw new \Exception('Filename doesnt exist.');

        return file_get_contents($filename);
    }
906463
public function getFileData($fileName)
    {
        if (!in_array($fileName, $this->files, true))
            return false;

        return $this->archive->getFileData($fileName);
    }
1088194
public function readFileContents($fileName = null)
    {
        //====================================================================//
        // Safety Checks
        if (empty($fileName)) {
            return Splash::log()->err("ErrFileFileMissing");
        }
        //====================================================================//
        // Check if file exists
        if (!is_file($fileName)) {
            return Splash::log()->err("ErrFileNoExists", $fileName);
        }
        //====================================================================//
        // Check if file is readable
        if (!is_readable($fileName)) {
            return Splash::log()->err("ErrFileReadable", $fileName);
        }
        Splash::log()->deb("MsgFileRead", $fileName);
        //====================================================================//
        // Read File Contents
        return base64_encode((string) file_get_contents($fileName));
    }
707865
protected function getFile($filename)
    {
        try {
            $api = $this->client->api('repositories');
            /* @var Repositories $api */
            $file = $api->getFile($this->raw['path_with_namespace'], $filename, 'master');
            if ('base64' === $file['encoding']) {
                return base64_decode($file['content'], true);
            }
        } catch (\Exception $e) {
            //file not found
        }
    }
1361363
public function fetchName(string $filename): ?string
    {
        return str_replace('\\', '/', substr($filename, 0, -1 * (1 + strlen($this->extension))));
    }
513467
protected function loadFile($filename)
    {
        if (!is_string($filename)) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 1 to be string, %s given', __METHOD__, gettype($filename)));
        }

        try {
            $content = file_get_contents($filename);
        } catch (\Exception $exception) {
            throw new RuntimeException(sprintf('Could not load file %s', $filename));
        }

        if ($content === false) {
            throw new RuntimeException(sprintf('Could not load file %s', $filename));
        }

        return $content;
    }
811276
public static function parseFile($filename) {
    $source = @file_get_contents($filename);
    if ($source === FALSE) {
      return FALSE;
    }
    return self::parseSource($source, $filename);
  }
1035829
public function fetch($filename): string {
        return $this->_getApi()->getObject([
            'Bucket' => $this->_config['bucket'],
            'Key' => $this->_getUri($filename),
        ])->get('Body');
    }
393885
public function getContents(string $fileName)
    {
        if (!file_exists($this->__path . $fileName)) {
            return null;
        }
        $r = include $this->__path . $fileName;
        return $r === false ? null : $r;
    }
84800
protected function getFile($filename)
    {
        $api = $this->api->api('Repositories\Src');
        /* @var Src $api */

        try {
            $file = $api->raw($this->raw['owner']['username'], $this->raw['name'], 'master', $filename);
            /** @var Response $file */
            if ($file->isSuccessful()) {
                return $file->getContent();
            }
        } catch (\Exception $e) {
            //file not found
        }
    }
129911
public function getFileContents($filename)
    {
        if ($contents = file_get_contents($filename)) {
            if (preg_match('/<body ?.*?>(.+)<\/body>/s', $contents, $matches)) {
                return $matches[1];
            } else { // it's not HTML, so output it as plain text
                return $contents;
            }
        }
        return FALSE;
    }
896931
public function getFileOutput($filename)
    {
        if (file_exists($filename)) {
            ob_start();
            include($filename);
            $content = ob_get_contents();
            ob_end_clean();
            $this->logger->info("View parsed - $filename");
        } else {
            $content = "";
        }
        return $content;
    }