Download the PHP package guzzlehttp/progress-subscriber without Composer

On this page you can find all versions of the php package guzzlehttp/progress-subscriber. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package progress-subscriber


Guzzle Progress Subscriber

Adds upload and download progress events to transfers.

<?php

require 'vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Subscriber\Progress\Progress;

$uploadCallback = function ($expected, $total, $client, $request) {
    printf("Upload: %d %% \r", 100 * ($total / $expected));
};

$downloadCallback = function ($expected, $total, $client, $request, $res) {
    printf("Download: %d %% \r", 100 * ($total / $expected));
};

$progress = new Progress($uploadCallback, $downloadCallback);

$client = new Client();
$client->put('http://httpbin.org/put', [
    'body'        => str_repeat('.', 10000),
    'subscribers' => [$progress],
]);

echo "\n";

Installing

This project can be installed using Composer. Add the following to your composer.json:

{
    "require": {
        "guzzlehttp/progress-subscriber": "~1.0"
    }
}

Constructor Options

The GuzzleHttp\Subscriber\Progress\Progress class accepts the following constructor arguments:

$uploadProgress (callable) A function that is invoked each time data is read from the upload stream. The event receives the expected number of bytes to transfer in the first argument, the total number of bytes transferred in the second argument, the client used to send the request in the third argument, and the request being sent in the fourth argument.

$downloadProgress (callable) A function that is invoked each time data is written to the response body. The event receives the expected number of bytes to download in the first argument, the total number of bytes downloaded in the second argument, the client that sent the request in the third argument, the request that was sent in the fourth argument, and the response being received in the fifth argument.


All versions of progress-subscriber with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
guzzlehttp/guzzle Version ~4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package guzzlehttp/progress-subscriber contains the following files

Loading the files please wait ....