zhusaidong/curlite
Composer 安装命令:
composer create-project zhusaidong/curlite
包简介
a Light-weight php curl
关键字:
README 文档
README
About
a Light-weight php curl
Usage
composer require zhusaidong/curlite
Examples
require_once './vendor/autoload.php'; use zhusaidong\CurLite\Request,zhusaidong\CurLite\Curl; $request = new Request('https://github.com/search'); $request->postFields = ['q'=>'php curl','type'=>'']; $request->referer = 'https://github.com/'; $cl = new Curl($request); $response = $cl->getResponse(); //if curl successed, the `$response->error` will equal `FALSE`. if($response->error === FALSE) { echo $response->body; } else { echo 'error:'.$response->error; }
Available Properties
Response Properties
/** * @var array $header response header */ $header = []; /** * @var string $body response body */ $body = ''; /** * @var int $httpCode http code */ $httpCode = ''; /** * @var string $cookie cookie */ $cookie = ''; /** * @var array $serverInfo server info */ $serverInfo = []; /** * @var string|booean $error error msg, if curl successed, the $error is FALSE */ $error = '';
Request Properties
/** * @const method get */ const METHOD_GET = 1; /** * @const method post */ const METHOD_POST = 2; /** * @var string $url request url */ $url = ''; /** * @var int $method request method, default is GET */ $method = self::METHOD_GET; /** * @var array $postFields request post data */ $postFields = []; /** * @var array $header request header */ $header = []; /** * @var string $referer request referer */ $referer = ''; /** * @var string $cookie cookie */ $cookie = ''; /** * @var string $userAgent user-agent */ $userAgent = ''; /** * @var boolean $isRandomIP is curl use random IP, default is FALSE */ $isRandomIP = FALSE; /** * @var string $caPath cafile path */ $caPath = ''; /** * @var int $timeout request timeout */ $timeout = 3; /** * @var int $followLocation follow the location, * set it zero can intercept the redirect */ $followLocation = 1;
zhusaidong/curlite 适用场景与选型建议
zhusaidong/curlite 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 44 次下载、GitHub Stars 达 4, 最近一次更新时间为 2017 年 12 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「curl」 「light-weight」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zhusaidong/curlite 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zhusaidong/curlite 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zhusaidong/curlite 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
php rest server for very light-weight REST APIs
cURL and cURL based Soap-Client for PHP
Simple cURL wrapper
A fluent PHP CURL wrapper
a modular, simple, and light-weight library that implements Bitbucket's web hooks.
Build mini web servers in PHP for testing
统计信息
- 总下载量: 44
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 4
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2017-12-18