public function readFile($filename)
    {
        if (is_file($filename) === false) {
            throw new FileNotFoundException(sprintf('File "%s" does not exist.', $filename));
        }
        if (is_readable($filename) === false) {
            throw new IOException(sprintf('File "%s" cannot be read.', $filename));
        }

        $content = file_get_contents($filename);

        if ($content === false) {
            throw new IOException(sprintf('Error reading the content of the file "%s".', $filename));
        }

        return $content;
    }
public function readFile($filename)
    {
        if (is_file($filename) === false) {
            throw new FileNotFoundException(sprintf('File "%s" does not exist.', $filename));
        }
        if (is_readable($filename) === false) {
            throw new IOException(sprintf('File "%s" cannot be read.', $filename));
        }

        $content = file_get_contents($filename);

        if ($content === false) {
            throw new IOException(sprintf('Error reading the content of the file "%s".', $filename));
        }

        return $content;
    }
public function readFile ( $ filename ) { if ( is_file ( $ filename ) === false ) { throw new FileNotFoundException ( sprintf ( 'File "%s" does not exist.' , $ filename ) ) ; } if ( is_readable ( $ filename ) === false ) { throw new IOException ( sprintf ( 'File "%s" cannot be read.' , $ filename ) ) ; } $ content = file_get_contents ( $ filename ) ; if ( $ content === false ) { throw new IOException ( sprintf ( 'Error reading the content of the file "%s".' , $ filename ) ) ; } return $ content ; }
Reads the content of a filename.

@param string The file to which to read the content.

@return string The content of the filename.

@throws FileNotFoundException When the filename does not exist.
@throws IOException           When the filename cannot be read or there is another problem.
Reads the content of a filename .