choval/reactphp-curl-proc

Async Curl using React\ChildProcess

v0.1.2 2019-09-03 17:42 UTC

This package is auto-updated.

Last update: 2022-05-12 01:56:14 UTC


README

WARNING: THIS IS NOT PRODUCTION READY

Async Curl library for ReactPHP. This library uses the curl binary of the system.

Rationale

HttpClient and BuzzBrowser are not capable of handling cookies and/or large file uploads.

Installation

composer require choval/reactphp-curl-proc:dev-master

Usage

use choval\React\Curl;
use choval\React\CurlResponse;

$loop = React\EventLoop\Factory::create();
$curl = new Curl($loop);

$curl->get('http://google.com/')
  ->then(function(CurlResponse $resp) {
    echo $resp->getBody();
  })
  ->otherwise(function(Exception $e) {
    echo 'ERROR: '.$e->getMessage().PHP_EOL;
  });