2017 © Pedro PelĂĄez
 

library hhcurl

cURL class for HHVM/Hack

image

kubotak-is/hhcurl

cURL class for HHVM/Hack

  • Thursday, March 1, 2018
  • by kubotak-is
  • Repository
  • 1 Watchers
  • 1 Stars
  • 263 Installations
  • Hack
  • 0 Dependents
  • 0 Suggesters
  • 80 Forks
  • 0 Open issues
  • 21 Versions
  • 0 % Grown

The README.md

HHVM/Hack Curl Class

This library provides an object-oriented wrapper of the HHVM/Hack cURL extension., (*1)

If you have questions or problems with installation or usage create an Issue., (*2)

Installation

In order to install this library via composer run the following command in the console:, (*3)

$ hhvm --php $(which composer) require kubotak-is/hhcurl

or add the package manually to your composer.json file in the require section:, (*4)

"kubotak-is/hhcurl": "^0.1"

Usage examples

$curl = new HHCurl\Curl();
\HH\Asio\join($curl->get('http://www.example.com/'));
$curl = new HHCurl\Curl();
\HH\Asio\join($curl->get('http://www.example.com/search', [
    'q' => 'keyword',
]));
$curl = new HHCurl\Curl();
\HH\Asio\join($curl->post('http://www.example.com/login/', [
    'username' => 'myusername',
    'password' => 'mypassword',
]));
$curl = new HHCurl\Curl();
$curl->setBasicAuthentication('username', 'password');
$curl->setUserAgent('');
$curl->setReferrer('');
$curl->setHeader('X-Requested-With', 'XMLHttpRequest');
$curl->setCookie('key', 'value');
\HH\Asio\join($curl->get('http://www.example.com/'));

if ($curl->error) {
    echo $curl->error_code;
}
else {
    echo $curl->response;
}

var_dump($curl->request_headers);
var_dump($curl->response_headers);
$curl = new HHCurl\Curl();
$curl->setOpt(CURLOPT_RETURNTRANSFER, TRUE);
$curl->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);
\HH\Asio\join($curl->get('https://encrypted.example.com/'));
$curl = new HHCurl\Curl();
\HH\Asio\join($curl->put('http://api.example.com/user/', [
    'first_name' => 'Zach',
    'last_name' => 'Borboa',
]));
$curl = new HHCurl\Curl();
\HH\Asio\join($curl->patch('http://api.example.com/profile/', [
    'image' => '@path/to/file.jpg',
]));
$curl = new HHCurl\Curl();
\HH\Asio\join($curl->delete('http://api.example.com/user/', [
    'id' => '1234',
]));
$curl->close();
// Example access to curl object.
curl_set_opt($curl->curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1');
curl_close($curl->curl);

 Testing

In order to test the library:, (*5)

  1. Create a fork
  2. Clone the fork to your machine
  3. Install the depencies composer install
  4. Run the unit tests ./vendor/bin/phpunit tests

The Versions

01/03 2018

dev-master

9999999-dev https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

 

The Development Requires

curl hack hhvm

28/02 2018
09/01 2018
05/01 2018
05/01 2018
05/01 2018
06/12 2017

dev-defeat

dev-defeat https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

 

The Development Requires

curl hack hhvm

05/12 2017
01/12 2017
28/11 2017

0.2.1

0.2.1.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

28/11 2017

0.2.0

0.2.0.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

27/11 2017

0.1.9

0.1.9.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

03/10 2017

0.1.8

0.1.8.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

19/07 2017

0.1.7

0.1.7.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

12/07 2017

0.1.6

0.1.6.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

03/07 2017

0.1.5

0.1.5.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

03/07 2017

0.1.4

0.1.4.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

05/06 2017

0.1.3

0.1.3.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

05/06 2017

0.1.2

0.1.2.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

31/05 2017

0.1.1

0.1.1.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm

31/05 2017

0.1.0

0.1.0.0 https://github.com/kubotak-is/hhcurl

cURL class for HHVM/Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.15
  • ext-curl *

 

The Development Requires

curl hack hhvm