src/Storage/FileStorage.php
public static function readFile($fileName, $options = [])
    {
        $reader = new File\FileReader($fileName, $options);
        $success = true;
        $contents = null;

        try {
            $reader->open();
            $contents = $reader->read();
        } catch (\RuntimeException $e) {
            self::$lastError = $e->getMessage();
            $success = false;
        }

        try {
            $reader->close();
        } catch (\RuntimeException $e) {
            self::$lastError = $e->getMessage();
            $success = false;
        }

        return ($success) ? $contents : false;
    }
public static function readFile($fileName, $options = [])
    {
        $reader = new File\FileReader($fileName, $options);
        $success = true;
        $contents = null;

        try {
            $reader->open();
            $contents = $reader->read();
        } catch (\RuntimeException $e) {
            self::$lastError = $e->getMessage();
            $success = false;
        }

        try {
            $reader->close();
        } catch (\RuntimeException $e) {
            self::$lastError = $e->getMessage();
            $success = false;
        }

        return ($success) ? $contents : false;
    }
public static function readFile ( $ fileName , $ options = [ ] ) { $ reader = new File \ FileReader ( $ fileName , $ options ) ; $ success = true ; $ contents = null ; try { $ reader -> open ( ) ; $ contents = $ reader -> read ( ) ; } catch ( \ RuntimeException $ e ) { self :: $ lastError = $ e -> getMessage ( ) ; $ success = false ; } try { $ reader -> close ( ) ; } catch ( \ RuntimeException $ e ) { self :: $ lastError = $ e -> getMessage ( ) ; $ success = false ; } return ( $ success ) ? $ contents : false ; }
Reads contents of a file to a string

Acquires blocking shared lock for the file.

@param string $fileName Name of the file to read.
@param array $options Options for the Reader instance
@return string|bool String with the file contents on success, FALSE otherwise.
Reads contents of a file to a string