amarkhai/parallel-downloader-bundle
composer require amarkhai/parallel-downloader-bundle
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',
]);
}
The method download has 2 additional parameters:
It's possible to change some parameters in configuration files:
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
How can I help you explore Laravel packages today?