protected static function readFile($file)
    {
        $length = filesize($file);

        if (!($fd = fopen($file, 'rb'))) {
            throw new Exception("Cannot read the file '$file', probably permissions");
        }

        $content = $length ? fread($fd, $length) : '';
        fclose($fd);

        return $content;
    }
protected static function readFile($file)
    {
        $length = filesize($file);

        if (!($fd = fopen($file, 'rb'))) {
            throw new Exception("Cannot read the file '$file', probably permissions");
        }

        $content = $length ? fread($fd, $length) : '';
        fclose($fd);

        return $content;
    }
protected static function readFile ( $ file ) { $ length = filesize ( $ file ) ; if ( ! ( $ fd = fopen ( $ file , 'rb' ) ) ) { throw new Exception ( "Cannot read the file '$file', probably permissions" ) ; } $ content = $ length ? fread ( $ fd , $ length ) : '' ; fclose ( $ fd ) ; return $ content ; }
Reads and returns the content of a file.

@param string $file

@return string
Reads and returns the content of a file .