Coder Social home page Coder Social logo

multi-get's Introduction

Multi-GET

This is a Laravel package containing a simplified version of a "download booster", which speeds up downloads by requesting files in multiple pieces simultaneously (saturating the network), then reassembling the pieces.

This project is my implementation of a coding exercise issued by Carnegie Technologies to candidates for Software Engineering positions.

Features

While I structured the core functionality of this package with an eye toward versatility, I was mindful of the fact that the exercise parameters explicitly prescribe a command-line interface.

My solution: a custom Artisan Command.

In addition to meeting the exercise requirements, I opted to implement all of the optional features cited in the exercise instructions, including:

  • Parallel (asynchronous) file download
  • Support for files smaller (or larger) than 4 MiB
  • Configurable number of chunks/chunk size/total download size

Installation

This package is designed to be loaded into an existing Laravel 5.4+ project using Composer. However, given that this was "only" a coding exercise, I did not take the additional step of registering it in Packagist.

It is therefore necessary to run the following command from your Terminal to add my repository to your composer.json file before you install the package:

composer config repositories.mphillipson vcs https://github.com/mphillipson/multi-get

Then run this command to add the package as a dependency:

composer require mphillipson/multi-get:dev-master

Don't forget to register the package service provider in your config/app.php file:

'providers' => [
    ...
    MPhillipson\Multiget\Providers\MultigetServiceProvider::class,
];

And finally, run the following command to publish the package config file to config/multiget.php (optional):

php artisan vendor:publish

Configuration

You can customize the property values in the published config/multiget.php file in order to adjust the default values for the target file path, number of chunks to download, chunk size, and more.

Many of these configuration options can be overriden via Artisan command options, as described below.

Usage

multiget:download

This Artisan command can be used to download part of a file from a URL to a default location (/tmp):

php artisan multiget:download [url]

To specify a destination other than the default, include the --target-file option:

php artisan multiget:download [url] --target-file=[/path/to/file]

Consult the command help to display and describe all of the available options for the multiget:download command:

php artisan help multiget:download

multi-get's People

Contributors

mphillipson avatar

Stargazers

Kaska Miskolczi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.