duncan3dc/guzzle-tools
Composer 安装命令:
composer require duncan3dc/guzzle-tools
包简介
A few tools for working with Guzzle
README 文档
README
A PHP library offering some add-ons for Guzzle.
Installation
The recommended method of installing this library is via Composer.
Run the following command from your project root:
$ composer require duncan3dc/guzzle-tools
Quick Examples
Logging
When working with Guzzle I got bored of searching for the solution to output the request/response every time I wanted a quick debug, this library makes it easy:
$client = \duncan3dc\Guzzle\Factory::getClient(); $client->request("GET", "http://example.com/");
Running the above would output this on the command line:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GET / HTTP/1.1
User-Agent: GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.1.0RC3
Host: example.com
--------------------------------------------------------------------------------
HTTP/1.1 200 OK
Cache-Control: max-age=604800
Content-Type: text/html
Date: Mon, 09 Jan 2017 14:42:17 GMT
Etag: "359670651+gzip+ident"
Expires: Mon, 16 Jan 2017 14:42:17 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Server: ECS (ewr/15BD)
Vary: Accept-Encoding
X-Cache: HIT
x-ec-custom-error: 1
Content-Length: 1270
<!doctype html>
<html>
<head>
<title>Example Domain</title>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is established to be used for illustrative examples in documents. You may use this
domain in examples without prior coordination or asking for permission.</p>
<p><a href="http://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Request Building
As of version 6.0.0 Guzzle no longer offers a way to build a request instance to send later, this library provides a simple workaround:
$request = \duncan3dc\Guzzle\Request::make("GET", "https://example.com/", [ "query" => [ "date" => date("Y-m-d"), ], ]); # There's also an alias on the main factory class $request = \duncan3dc\Guzzle\Factory::request("GET", "https://example.com/");
Simple Requests
When all you need is a basic GET/POST, you can use the Http class:
$response = \duncan3dc\Guzzle\Http::get("https://example.com/", [ "date" => date("Y-m-d"), ]); $response = \duncan3dc\Guzzle\Http::post("https://example.com/", [ "date" => date("Y-m-d"), ]);
Changelog
A Changelog has been available since the beginning of time
Where to get help
Found a bug? Got a question? Just not sure how something works?
Please create an issue and I'll do my best to help out.
Alternatively you can catch me on Twitter
duncan3dc/guzzle-tools for enterprise
Available as part of the Tidelift Subscription
The maintainers of duncan3dc/guzzle-tools and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
duncan3dc/guzzle-tools 适用场景与选型建议
duncan3dc/guzzle-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 275 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 01 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「log」 「debug」 「Guzzle」 「output」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 duncan3dc/guzzle-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 duncan3dc/guzzle-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 duncan3dc/guzzle-tools 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Debug your SimpleBus EventBus and CommandBus
nice output for debug functions for PHP 5.3
Analysis module for finding problematical shop data.
Twig extensions for Tracy Debugger
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
Laravel 5.x.x library for integration Monolog Sentry
统计信息
- 总下载量: 275
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-01-15