Downloader component.
Add Downloader in your composer.json:
{
"require": {
"tadcka/downloader": "dev-master"
}
}
Now tell composer to download the component by running the command:
$ php composer.phar update tadcka/downloader
File downloader example:
use Tadcka\Component\Downloader\FileDownloader;
use Symfony\Component\Filesystem\Filesystem;
...
$fileDownloader = new FileDownloader(new Filesystem());
$fileDownloader->download('https://test.org/test.txt', '/download-test/');
Image downloader example:
use Tadcka\Component\Downloader\Image\ImageDownloader;
use Symfony\Component\Filesystem\Filesystem;
...
$imageDownloader = new ImageDownloader(new Filesystem());
$imageDownloader->download('https://test.org/test.png', '/download-test/');