amarkhai/parallel-downloader-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

amarkhai/parallel-downloader-bundle

Composer 安装命令:

composer require amarkhai/parallel-downloader-bundle

包简介

The bundle for downloading files concurrently

README 文档

README

Installation

composer require amarkhai/parallel-downloader-bundle

Usage

For downloading run method "download" with an array<string, string>, where value is the link for file which you need to download and key is the name which will be used for saving the file:

    public function __construct(DownloadManager $downloadManager)
    {
        $this->downloadManager = $downloadManager;
    }
    
    public function foo()
    {
        $this->downloadManager->download([
            'filename1' => 'https://mysite.com/test1.png',
            'filename2' => 'https://mysite.com/test2.png',
            'filename3' => 'https://mysite.com/test3.png',
        ]);
    }

Additional parameters

The method download has 2 additional parameters:

  • subFolder - the name of folder inside download folder (see below) where files from the list will be saved
  • options - Array of Guzzle request options to apply to each request.

Configuration

It's possible to change some parameters in configuration files:

  • Folder for saving files
  • Quantity of retries after failure downloadings
  • Maximum number of requests to send concurrently

Here are default values for these parameters:

# config/packages/amarkhai_parallel_downloader.yaml
parameters:
  amarkhai_parallel_downloader.download_files_folder: '%kernel.project_dir%/var/downloads'
  amarkhai_parallel_downloader.download_retry: 3
  amarkhai_parallel_downloader.download_concurrency: 10

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固