xpaw/crimp
最新稳定版本:3.1.0
Composer 安装命令:
composer require xpaw/crimp
包简介
A simple multi curl implementation, optimized for high concurrency.
README 文档
README
A simple multi curl implementation, optimized for high concurrency.
This is practically a bare bones implemention. Retrying, HTTP code checking and other stuff is up to the user.
Usage:
$Crimp = new Crimp( function( CurlHandle $Handle, string $Data, $Request ) : void { // $Handle is the cURL handle // $Data is the content of a cURL handle // $Request is whatever was queued } ); // How many concurrent threads to use $Crimp->Threads = 10; // Set any curl option that are needed $Crimp->CurlOptions[ CURLOPT_FOLLOWLOCATION ] = 1; // Queue urls $Crimp->Add( 'https://example.com/?v=1' ); $Crimp->Add( 'https://example.com/?v=2' ); // Queue an array, it must contain a `Url` key $Crimp->Add( [ 'Url' => 'https://example.com/?v=3' ] ); // Queue an object, it must contain a `Url` property class RequestUrl { public string $Url; } $request = new RequestUrl(); $request->Url = 'https://example.com/?v=4'; $Crimp->Add( $request ); // Execute the requests $Crimp->Go();
CURLOPT_RETURNTRANSFER is enabled by default. See examples folder for more.
If you need a fully featured multi cURL implemention, take a look at Zebra_cURL or Guzzle instead.
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 26
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-06-17