PHPackages                             shellus/multi-curl - 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. shellus/multi-curl

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

shellus/multi-curl
==================

v1.0.1(9y ago)6174PHP

Since Nov 23Pushed 9y ago3 watchersCompare

[ Source](https://github.com/shellus/multi-curl)[ Packagist](https://packagist.org/packages/shellus/multi-curl)[ RSS](/packages/shellus-multi-curl/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

Multi-curl
==========

[](#multi-curl)

PHP异步CURL，轻易的在PHP中进行并发的http请求，可用于针对复杂接口的压力测试

### 特点

[](#特点)

- 自动的编码解码，使用`FormRequest`来自动编码form表单提交，使用JsonResponse来自动解码返回的json数据
- 和其他压力测试工具不同，本公举支持POST、请求构造等特性。

### 安装

[](#安装)

```
composer require shellus/multi-curl
```

### 示例代码

[](#示例代码)

```
/**
 * 单请求多并发示例
 * User: shellus-out
 * Date: 2016/11/25
 * Time: 10:16
 */

// 处理接收到的数据
function handleResult(\MultiCurl\Response $response){
    $info = $response -> getInfo();

    $text = substr($response -> getContent(), 0, 200);
    $text = str_replace("\r\n", "\n", $text);
    $text = str_replace("\n", "", $text);

    var_dump('url: ' . $info['url'], 'content: ' . $text);
}

// 并发50
$m = new \MultiCurl\MultiCurl(50);

for($i =0; $i < 10; $i++){
    $url = 'http://www.xjflcp.com/game/SelectDate';
    $data = ['selectDate'=>'20161122'];
    $request = new MultiCurl\FormRequest($url, $data);
    $request -> setClosure('handleResult');
    $m -> pushRequest($request);
}

$m -> exec();

```

更多例子请查阅`examples`文件夹

### 本项目参考了以下页面

[](#本项目参考了以下页面)

- php curl文档 ：

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

2

Last Release

3458d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/shellus-multi-curl/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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