2017 © Pedro Peláez
 

library curl

Object oriented wrapper for curl functions.

image

skoro/curl

Object oriented wrapper for curl functions.

  • Saturday, August 19, 2017
  • by skoro
  • Repository
  • 1 Watchers
  • 0 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Curl

Object oriented wrapper for curl functions. Wrappers for curl and curl_multi functions are available., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist skoro/curl "*"

or add, (*4)

"skoro/curl": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

// Include composer autoload script.
require 'vendor/autoload.php';

use skoro\curl\Curl;

// Simple GET request.
$content = Curl::get('google.com');

// HEAD request
$curl = new Curl('google.com', 'HEAD');
$body = $curl->request(); // Returns response with headers.
         $curl->getResponse(); // Returns "raw" response.
         $curl->getResponseHeaders(); // Returns array of headers.
}

Curl multi usage:, (*7)

require 'vendor/autoload.php';

use skoro\curl\Multi;
use skoro\curl\Curl;

$multi = new Multi();
// Attach curl instances and run them.
$multi->add(new Curl('google.com', 'HEAD'))
      ->add(new Curl('microsoft.com', 'HEAD'))
      ->add(new Curl('amazon.com'))
      ->run();
// Get responses.
foreach ($multi as $curl) {
    var_dump($curl->getResponse());
}

Exceptions

  • HttpException throws by Curl::request() for requests except HEAD when returned response status not in range 200 ... 300 codes.

The Versions

19/08 2017

dev-master

9999999-dev

Object oriented wrapper for curl functions.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3
  • ext-curl *

 

by Skorobogatko Alexei

curl http client multi curl

11/05 2017

0.2.2

0.2.2.0

Object oriented wrapper for curl functions.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3
  • ext-curl *

 

by Skorobogatko Alexei

curl multi curl

11/05 2017

0.2.1

0.2.1.0

Object oriented wrapper for curl functions.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3
  • ext-curl *

 

by Skorobogatko Alexei

curl multi curl

04/05 2017

0.2

0.2.0.0

Object oriented wrapper for curl functions.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3
  • ext-curl *

 

by Skorobogatko Alexei

curl multi curl

30/10 2015

0.1

0.1.0.0

Object oriented wrapper for curl functions.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3

 

by Skorobogatko Alexei

curl multi curl