lezhnev74 / simple-downloader
Simple file downloader
Installs: 57
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 4
pkg:composer/lezhnev74/simple-downloader
Requires
- php: >=5.6
Requires (Dev)
- php: >=5.6
- fzaninotto/faker: ^1.5
- mockery/mockery: ^0.9.4
- phpunit/phpunit: 5.1.*
This package is auto-updated.
Last update: 2025-09-29 01:58:50 UTC
README
Simple Downloader (forked from kodify/DownloaderBundle but with no dependency on Symfony framework)
What is this Downloader?
It's a simple yet functional downloader that simply makes what it says in the tin, downloads the url specified in the specified path.
Installation
PHP 5.6+
Install PHP 5.6+ to use it
Composer:
Add the following dependencies to your projects composer.json file:
composer require lezhnev74/simple-downloader
Usage
use Exception;
use InvalidArgumentException;
use SimpleDownloader\Classes\Downloader;
use SimpleDownloader\Exceptions\FileException;
try {
$downloader = new Downloader();
$downloader->downloadFile("http://google.com/robots.txt", "/tmp", "robots.txt");
echo "File was downloaded successfully!";
} catch(FileException $e) {
echo "We have a problem with file: ".$e->getMessage();
} catch(InvalidArgumentException $e) {
echo "Wrong arguments are passed: ".$e->getMessage();
} catch(Exception $e) {
echo "Something bad happened: ".$e->getMessage();
}