src/FileDownload.php
public static function createFromFilePath ($filePath)
    {
        if (!is_file($filePath))
        {
            throw new \InvalidArgumentException("File does not exist");
        }
        else if (!is_readable($filePath))
        {
            throw new \InvalidArgumentException("File to download is not readable.");
        }

        return new FileDownload(fopen($filePath, "rb"));
    }
public static function createFromFilePath ($filePath)
    {
        if (!is_file($filePath))
        {
            throw new \InvalidArgumentException("File does not exist");
        }
        else if (!is_readable($filePath))
        {
            throw new \InvalidArgumentException("File to download is not readable.");
        }

        return new FileDownload(fopen($filePath, "rb"));
    }
public static function createFromFilePath ( $ filePath ) { if ( ! is_file ( $ filePath ) ) { throw new \ InvalidArgumentException ( "File does not exist" ) ; } else if ( ! is_readable ( $ filePath ) ) { throw new \ InvalidArgumentException ( "File to download is not readable." ) ; } return new FileDownload ( fopen ( $ filePath , "rb" ) ) ; }
Creates a new file download from a file path

@static

@param string $filePath

@throws \InvalidArgumentException is thrown, if the given file does not exist or is not readable

@return FileDownload
Creates a new file download from a file path