lezhnev74/simple-downloader
Composer 安装命令:
composer require lezhnev74/simple-downloader
包简介
Simple file downloader
README 文档
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();
}
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2015-12-27