承接 somov/yii2-large-file-downloader 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

somov/yii2-large-file-downloader

Composer 安装命令:

composer require somov/yii2-large-file-downloader

包简介

Download file in multiple streams. With the ability to resume and monitor progress

README 文档

README

It is yii2 extension based on yii2-httpclient

Download file in multiple streams. With the ability to resume and monitor progress.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist somov/yii2-large-file-downloader "~1.0"

or add

"somov/yii2-large-file-downloader": "~1.0"

to the require section of your composer.json file.

Usage

        /** @var \somov\lfd\Client $client */
        $client = Yii::createObject([
            'class' => \somov\lfd\Client::class,
            //'threadCount' => 5,
            //'resumeDownload' =>  true,
            //'tmpAlias' => '@runtime/downloads' 
        ]);

        $client->on(\somov\lfd\Client::EVENT_PROGRESS, function ($event){
            /** @var \somov\lfd\ProgressEvent $event */
            echo  $event->percent;
        });

        //Download file   
        $fileName = $client->download("https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4")->data;

        $size = filesize($fileName); 
        
        echo $size;

Usage with command controller


Configure the command in your main application configuration:
    'controllerMap' => [
            'downloader' => '\somov\lfd\CommandController'
        ],

Once the extension is installed and configured, simply use it on your command line

yii downloader  https://speed.hetzner.de/1GB.bin -c 20

screen

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2019-04-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固