Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Jul 27, 2018
1 parent ca9bd2b commit 0721078
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cURL object wrapper.
====================

This library simply wraps PHP's native cURL extension functions with objects, for better code readability and testability.

Why? We wanted to lay an object oriented foundation for [PHP.Gt/Fetch](https://php.gt/fetch), our PHP implementation of the web's fetch API that uses cURL to create asynchronous HTTP calls with promises.

Example:

```php
// Native curl functions:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://google.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);

// Object-wrapped alternative:
$curl = new Curl();
$curl->setOpt(CURLOPT_URL, "https://google.com");
$curl->setOpt(CURLOPT_RETURNTRANSFER, true);
$result = curl_exec();
```

0 comments on commit 0721078

Please sign in to comment.