PHPackages                             alxdorosenco/curl-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. alxdorosenco/curl-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

alxdorosenco/curl-php
=====================

This is an easy builder of the cURL library in php

v8.2.1(2y ago)1170MITPHPPHP ^8.0

Since Dec 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alxdorosenco/curl-php)[ Packagist](https://packagist.org/packages/alxdorosenco/curl-php)[ Docs](https://github.com/alxdorosenco/curl-php)[ RSS](/packages/alxdorosenco-curl-php/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Curl PHP
========

[](#curl-php)

This is a PHP package of the Curl library who helps work with cUrl with more shortly and comfortable.

You can find additional information in the documentation via this link

[](https://www.php.net/manual/en/book.curl.php)

Requirements
============

[](#requirements)

From PHP version 8.0

How to install?
===============

[](#how-to-install)

```
composer require alxdorosenco/curl-php

```

Example №1
----------

[](#example-1)

Standard code

```
$curl = curl_init();

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERAGENT, 'Dark Secret Ninja/1.0');
curl_setopt($curl, CURLOPT_URL, 'https://example.com');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_POSTFIELDS, [
    'key' => 'value'
]);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
    'Content-Type: application/pdf'
]);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);

$out = curl_exec($curl);
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);

curl_close($curl);
```

Package code

```
require __DIR__ . '/vendor/autoload.php';
use AlxDorosenco\CurlPhp\Curl;
use AlxDorosenco\CurlPhp\CurlOpts;

$curl = new Curl();

$curl->build(
    CurlOpts::instance()
        ->setReturnTransfer()
        ->setUserAgent('Dark Secret Ninja/1.0')
        ->setUrl('https://example.com')
        ->setCustomRequest('POST')
        ->setPostFields([
            'key' => 'value'
        ])
        ->setHttpHeader([
            'Content-Type: application/pdf'
        ])
        ->setHeader(false)
        ->setSslVerifyPeer(false)
        ->setSslVerifyHost(0)
);

$out = $curl->exec();
$code = $curl->getInfo(CURLINFO_HTTP_CODE);

$curl->close();
```

Example №2
----------

[](#example-2)

Standard code

```
$ch1 = curl_init();
$ch2 = curl_init();

curl_setopt($ch1, CURLOPT_URL, "https://example.com");
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch2, CURLOPT_URL, "https://example.com");
curl_setopt($ch2, CURLOPT_HEADER, 0);

$mh = curl_multi_init();

curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);

do {
    $status = curl_multi_exec($mh, $active);
    if ($active) {
        curl_multi_select($mh);
    }
} while ($active && $status == CURLM_OK);

curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
curl_multi_close($mh);
```

Package code

```
require __DIR__ . '/vendor/autoload.php';
use AlxDorosenco\CurlPhp\Curl;
use AlxDorosenco\CurlPhp\CurlMulti;
use AlxDorosenco\CurlPhp\CurlOpts;

$ch1 = new Curl();
$ch2 = new Curl();

$ch1->build(
    CurlOpts::instance()
        ->setUrl('https://example.com')
        ->setHeader(false)
);

$ch2->build(
    CurlOpts::instance()
        ->setUrl('https://example.com')
        ->setHeader(false)
);

$mh = new CurlMulti();

$mh->addHandle($ch1);
$mh->addHandle($ch2);

do {
    $status = $mh->exec($active);
    if ($active) {
        $mh->select($mh);
    }
} while ($active && $status == CURLM_OK);

$mh->removeHandle($ch1);
$mh->removeHandle($ch2);
$mh->close();
```

Example №3
----------

[](#example-3)

Standard code

```
$sh = curl_share_init();
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);

$ch1 = curl_init("http://example.com/");
curl_setopt($ch1, CURLOPT_SHARE, $sh);

curl_exec($ch1);

$ch2 = curl_init("http://php.net/");
curl_setopt($ch2, CURLOPT_SHARE, $sh);

curl_exec($ch2);

curl_share_close($sh);

curl_close($ch1);
curl_close($ch2);
```

Package code

```
require __DIR__ . '/vendor/autoload.php';
use AlxDorosenco\CurlPhp\Curl;
use AlxDorosenco\CurlPhp\CurlShare;
use AlxDorosenco\CurlPhp\CurlOpts;

$sh = new CurlShare();
$sh->build(
    CurlOpts::share()->setShare(CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE)
);

$ch1 = new Curl("http://example.com/");
$ch1->build(
    CurlOpts::instance()->setShare(CURLOPT_SHARE, $sh)
);

$ch1->exec();

$ch2 = new Curl("http://php.net/");
$ch2->build(
    CurlOpts::instance()->setShare(CURLOPT_SHARE, $sh)
);

$ch2->exec();

$sh->close();

$ch1->close();
$ch2->close();
```

License
-------

[](#license)

Released under the MIT License, see [LICENSE](LICENSE).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

926d ago

Major Versions

v1.0.0 → v8.0.02023-12-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8394b8b5a0ee00734763f1295522bde2c829bfe15bfdfb38234b76c6c79d43e?d=identicon)[AlxDorosenco](/maintainers/AlxDorosenco)

---

Top Contributors

[![alxdorosenco](https://avatars.githubusercontent.com/u/63168699?v=4)](https://github.com/alxdorosenco "alxdorosenco (16 commits)")

---

Tags

phpcurlfilecontentsourcepostphp-curlopen-sourcecurl php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alxdorosenco-curl-php/health.svg)

```
[![Health](https://phpackages.com/badges/alxdorosenco-curl-php/health.svg)](https://phpackages.com/packages/alxdorosenco-curl-php)
```

###  Alternatives

[stefangabos/zebra_curl

A high performance solution for making multiple HTTP requests concurrently, asynchronously from your PHP projects using cURL

21672.4k2](/packages/stefangabos-zebra-curl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
