2017 © Pedro Peláez
 

library axel

Accelerated file downloads in PHP using Axel

image

axel-php/axel

Accelerated file downloads in PHP using Axel

  • Sunday, June 7, 2015
  • by ianoshorty
  • Repository
  • 1 Watchers
  • 7 Stars
  • 49 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 14 Versions
  • 4 % Grown

The README.md

AXEL-PHP - Axel Accelerated Download Functionality For PHP

Codeship Status for ianoshorty/axel-php Code Climate Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

General

The AXEL-PHP library wraps around the C based Axel library. Axel performs accelerated downloads from the command line, similar to wget., (*2)

AXEL-PHP offers asynchronous and synchronous downloads. See below for usage., (*3)

AXEL-PHP also comes with an optional FIFO download manager with the ability to set numbers of current downloads. Just implement AxelDownloadManagerQueueInterface together with your favourite queuing service., (*4)

** PLEASE NOTE: This library is under active development as an alpha and is subject to change at any time. **, (*5)

Example Usages

Sync Download With Complete Callback

$axel = new Axel\AxelDownload();
$axel->start('http://www.google.com', null, null, function($axel, $status, $success, $error) {
    echo 'File Downloaded';
    print_r($status);
});

Start Async Download

$axel = new Axel\AxelDownload();
$axel->startAsync('http://ipv4.download.thinkbroadband.com/1GB.zip', 'test.zip', '~/');

Start Async Download With Progress Callbacks

$axel = new Axel\AxelDownload();
$axel->startAsync('http://ipv4.download.thinkbroadband.com/1GB.zip', 'test.zip', '~/', function($axel, $status, $success, $error) {
   echo 'Progress updated';
   print_r($status);
});

Setup Download / Delayed Start

$axel = new Axel\AxelDownload();
$axel->addDownloadParameters([
    'address'           => 'http://www.google.com',
    'filename'          => 'test.html',
    'download-path'     => '~/',
    'callback'          => function($axel, $status, $success, $error) {
        echo 'Progress updated';
        print_r($status);
    }
]);
$axel->startAsync();

Get Download Status

$status = $axel->updateStatus();

Cleanup

$axel->clearCompleted()

Axel Managed Download Queue (Synchronous)

$dm = new Axel\AxelDownloadManager(new AxelDownloadManagerSyncQueue(), 'axel');
$dm->queueDownload('http://www.google.com', 'file1.html');
$dm->queueDownload('http://www.yahoo.com', 'file2.html');
$dm->processQueue();

Version

0.0.13, (*6)


Installation

Prerequesites

In order to install RPVR you will need:, (*7)

  • PHP 5.4 or higher
  • Axel - A linux server with Axel installed

Install Instructions

The preferred method of installation is via Composer and Packagist., (*8)

  1. Install the axel command-line tool on the target system - $ sudo apt-get install axel
  2. Install the AXEL-PHP library - $ composer require axel-php/axel

Development

Want to contribute? Great! Feel free to get in touch with me and we can collaborate, or fork / pull as you like., (*9)

TODO

  • Possible log options / write to log file?
  • Intelligently deal with both concurrent connections and concurrent downloads
  • Check write permissions in download directory
  • Pause queue (Maybe subclass?)
  • Test queue Async

License

The MIT License (MIT), (*10)

Copyright (c) 2015 Ian Outterside (Ian Builds Apps)., (*11)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*12)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*13)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*14)

The Versions

07/06 2015

dev-develop

dev-develop

Accelerated file downloads in PHP using Axel

  Sources   Download

MIT

The Requires

 

The Development Requires

download download manager file download download queue download accelerator

07/06 2015

dev-master

9999999-dev

Accelerated file downloads in PHP using Axel

  Sources   Download

MIT

The Requires

 

The Development Requires

download download manager file download download queue download accelerator

07/06 2015

0.0.13

0.0.13.0

Accelerated file downloads in PHP using Axel

  Sources   Download

MIT

The Requires

 

The Development Requires

download download manager file download download queue download accelerator

06/06 2015

0.0.12

0.0.12.0

Accelerated file downloads in PHP using Axel

  Sources   Download

MIT

The Requires

 

The Development Requires

download download manager file download download queue download accelerator

06/06 2015

0.0.11

0.0.11.0

Accelerated file downloads in PHP using Axel

  Sources   Download

MIT

The Requires

 

The Development Requires

download download manager file download download queue download accelerator

03/06 2015

0.0.10

0.0.10.0

Accelerated file downloads in PHP using Axel

  Sources   Download

MIT

The Requires

 

The Development Requires

download download manager file download download queue download accelerator

03/06 2015

0.0.9

0.0.9.0

A PHP library to use the Axel command line file downloader with download acceleration.

  Sources   Download

MIT

The Requires

 

The Development Requires

download download manager file download download queue axel axel-php

03/06 2015

0.0.8

0.0.8.0

A PHP library to use the Axel command line file downloader with download acceleration.

  Sources   Download

MIT

The Requires

 

The Development Requires

download download manager file download download queue axel axel-php

02/06 2015

0.0.7

0.0.7.0

A PHP library to access the Axel command line downloader.

  Sources   Download

MIT

The Requires

 

The Development Requires

axel axel-php

02/06 2015

0.0.6

0.0.6.0

A PHP library to access the Axel command line downloader.

  Sources   Download

MIT

The Requires

 

The Development Requires

axel axel-php

02/06 2015

0.0.5

0.0.5.0

A PHP library to access the Axel command line downloader.

  Sources   Download

MIT

The Requires

 

The Development Requires

axel axel-php

02/06 2015

0.0.4

0.0.4.0

A PHP library to access the Axel command line downloader.

  Sources   Download

MIT

The Requires

 

The Development Requires

axel axel-php

02/06 2015

0.0.3

0.0.3.0

A PHP library to access the Axel command line downloader.

  Sources   Download

MIT

The Requires

 

The Development Requires

axel axel-php

02/06 2015

0.0.2

0.0.2.0

A PHP library to access the Axel command line downloader.

  Sources   Download

MIT

The Requires

 

The Development Requires

axel axel-php