定制 marius321967/php-curl-class 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

marius321967/php-curl-class

最新稳定版本:4.0.0

Composer 安装命令:

composer require marius321967/php-curl-class

包简介

PHP Curl Class is an object-oriented wrapper of the PHP cURL extension.

README 文档

README

PHP Curl Class that makes use of PHP interfaces.

Changes

MultiCurl's addGet, addPost, etc. calls changed to get, post and so on.

Regular Curl

// Our response.
$response = null;

// Single Curl request object.
$curl = new Curl();

// Bind success callback.
$curl->success(function($curl) use (&$response) {
    $response = $curl->response;
});

// Send the request.
$curl->get('http://example.com/');

echo $response;

Async Curl

// Our response.
$response = null;

// Async Curl handler.
$multiCurl = new MultiCurl();

// Add a get request to the queue, it returns the single request object.
$curl = $multiCurl->get('http://example.com/');

// Bind success callback.
$curl->success(function($curl) use (&$response) {
    $response = $curl->response;
});

// Execute all requests in the queue.
$multiCurl->start();

echo $response;

Notes

For other features, read the Original Package documentation.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 674
  • 开发语言: PHP

其他信息

  • 授权协议: Unlicense
  • 更新时间: 2015-08-22