Skip to content

choval/reactphp-curl-proc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reactphp-curl-proc

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;
  });