PHPackages                             jaeger/querylist-curl-multi - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jaeger/querylist-curl-multi

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jaeger/querylist-curl-multi
===========================

QueryList Plugin: Curl multi threading. QueryList Curl多线程插件

4.0.1(7y ago)209.9k↓33.3%16[1 PRs](https://github.com/jae-jae/QueryList-CurlMulti/pulls)1MITPHPPHP &gt;=7.0

Since Sep 28Pushed 2y ago2 watchersCompare

[ Source](https://github.com/jae-jae/QueryList-CurlMulti)[ Packagist](https://packagist.org/packages/jaeger/querylist-curl-multi)[ RSS](/packages/jaeger-querylist-curl-multi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (1)

QueryList-CurlMulti
===================

[](#querylist-curlmulti)

QueryList Plugin: Curl multi threading.

QueryList插件: Curl多线程.

php-curlmulti:

> QueryList:

Installation for QueryList4
---------------------------

[](#installation-for-querylist4)

```
composer require jaeger/querylist-curl-multi

```

API
---

[](#api)

- CurlMulti **curlMulti($urls = \[\])**: Set the list of URLs to be collected.
- class **CurlMulti**

    - CurlMulti **add($urls)**:Add url task.
    - array **getUrls()**:Get all url.
    - CurlMulti **success(Closure $callback)**:Called if task is success.
    - CurlMulti **error(Closure $callback)**:Callback for failed tasks.
    - CurlMulti **start(array $opt = \[\])**:Start all tasks.This is a blocked method.

Installation options
--------------------

[](#installation-options)

**QueryList::use(CurlMulti::class,$opt1)**

- **$opt1**:`curlMulti` function alias.

Usage
-----

[](#usage)

- Installation Plugin

```
use QL\QueryList;
use QL\Ext\CurlMulti;

$ql = QueryList::getInstance();
$ql->use(CurlMulti::class);
//or Custom function name
$ql->use(CurlMulti::class,'curlMulti');
```

- Example-1

Collecting GitHub Trending:

```
$ql->rules([
    'title' => ['h3 a','text'],
    'link' => ['h3 a','href']
])->curlMulti([
    'https://github.com/trending/php',
    'https://github.com/trending/go'
])->success(function (QueryList $ql,CurlMulti $curl,$r){
    echo "Current url:{$r['info']['url']} \r\n";
    $data = $ql->query()->getData();
    print_r($data->all());
})->start();
```

Out:

```
Current url:https://github.com/trending/php
Array
(
    [0] => Array
        (
            [title] => jupeter / clean-code-php
            [link] => /jupeter/clean-code-php
        )
    [1] => Array
        (
            [title] => laravel / laravel
            [link] => /laravel/laravel
        )
    [2] => Array
        (
            [title] => spatie / browsershot
            [link] => /spatie/browsershot
        )
   //....
)

Current url:https://github.com/trending/go
Array
(
    [0] => Array
        (
            [title] => DarthSim / imgproxy
            [link] => /DarthSim/imgproxy
        )
    [1] => Array
        (
            [title] => jaegertracing / jaeger
            [link] => /jaegertracing/jaeger
        )
    [2] => Array
        (
            [title] => jdkato / prose
            [link] => /jdkato/prose
        )
  //...
)

```

- Example-2

```
$ql->curlMulti('https://github.com/trending/php')
    ->success(function (QueryList $ql,CurlMulti $curl,$r){
        echo "Current url:{$r['info']['url']} \r\n";
        if($r['info']['url'] == 'https://github.com/trending/php'){
            // append a task
            $curl->add('https://github.com/trending/go');
        }
        $data = $ql->find('h3 a')->texts();
        print_r($data->all());
    })
    ->start();
```

Out:

```
Current url:https://github.com/trending/php
Array
(
    [0] => jupeter / clean-code-php
    [1] => laravel / laravel
    [2] => spatie / browsershot
   //...
)

Current url:https://github.com/trending/go
Array
(
    [0] => DarthSim / imgproxy
    [1] => jaegertracing / jaeger
    [2] => jdkato / prose
    //...
)

```

- Example-3

```
$ql->curlMulti([
    'https://github-error-host.com/trending/php',
    'https://github.com/trending/go'
])->success(function (QueryList $ql,CurlMulti $curl,$r){
    echo "Current url:{$r['info']['url']} \r\n";
    $data = $ql->rules([
        'title' => ['h3 a','text'],
        'link' => ['h3 a','href']
    ])->query()->getData();
    print_r($data->all());
})->error(function ($errorInfo,CurlMulti $curl){
    echo "Current url:{$errorInfo['info']['url']} \r\n";
    print_r($errorInfo['error']);
})->start([
    // Max concurrence num, can be changed in the fly.
    'maxThread' => 10,
    // Trigger curl error or user error before max try times reached.If reached $error will be called.
    'maxTry' => 3,
    // Global CURLOPT_* for all tasks.
    'opt' => [
        CURLOPT_TIMEOUT => 10,
        CURLOPT_CONNECTTIMEOUT => 1,
        CURLOPT_RETURNTRANSFER => true
    ],
    // Cache is identified by url.If cache finded,the class will not access the network,but return the cache directly.
    'cache' => ['enable' => false, 'compress' => false, 'dir' => null, 'expire' =>86400, 'verifyPost' => false]
]);
```

Out:

```
Current url:https://github.com/trending/go
Array
(
    [0] => Array
        (
            [title] => DarthSim / imgproxy
            [link] => /DarthSim/imgproxy
        )
    [1] => Array
        (
            [title] => jaegertracing / jaeger
            [link] => /jaegertracing/jaeger
        )
    [2] => Array
        (
            [title] => getlantern / lantern
            [link] => /getlantern/lantern
        )
   //...
)

Current url:https://github-error-host.com/trending/php
Array
(
    [0] => 28
    [1] => Resolving timed out after 1000 milliseconds
)

```

- Example-3

```
$ql->rules([
    'title' => ['h3 a','text'],
    'link' => ['h3 a','href']
])->curlMulti()->add('https://github.com/trending/go')
    ->success(function (QueryList $ql,CurlMulti $curl,$r){
        echo "Current url:{$r['info']['url']} \r\n";
        $data = $ql->query()->getData();
        print_r($data->all());
})->start()
    ->add('https://github.com/trending/php')
    ->start();
```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity59

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 ~382 days

Total

2

Last Release

2768d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/351bb9fcc9e4784597bdeba01667aca7dcf4f56927bb18341d20470fc3295ae6?d=identicon)[jae](/maintainers/jae)

---

Top Contributors

[![jae-jae](https://avatars.githubusercontent.com/u/5620429?v=4)](https://github.com/jae-jae "jae-jae (10 commits)")

### Embed Badge

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

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

###  Alternatives

[bjornjohansen/wp-pre-commit-hook

Pre-commit hook for WordPress projects

118.8k3](/packages/bjornjohansen-wp-pre-commit-hook)[scolib/bankcard

根据银行卡号识别所属银行以及卡类型

171.3k1](/packages/scolib-bankcard)

PHPackages © 2026

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