e-moe/guzzle6-bundle
Composer 安装命令:
composer require e-moe/guzzle6-bundle
包简介
Integrates Guzzle 6 into your Symfony application
README 文档
README
This bundle integrates Guzzle 6.x into Symfony. Guzzle is a PHP framework for building RESTful web service clients.
Requirements
- PHP 5.6 or above
- Symfony 2.7 or above (including Symfony 3.x, 4.x, 5.x)
Installation
To install this bundle, run the command below and you will get the latest version by Packagist.
composer require e-moe/guzzle6-bundle
To use the newest (maybe unstable) version please add following into your composer.json:
{
"require": {
"e-moe/guzzle6-bundle": "dev-master"
}
}
Usage
Load bundle in AppKernel.php (should be done automatically if you are using Symfony Flex):
new Emoe\GuzzleBundle\EmoeGuzzleBundle(),
Configuration in config.yml (optional):
emoe_guzzle: log: enabled: true # Logging requests to Monolog format: 'Guzzle: [{ts}] "{method} {uri} HTTP/{version}" {code}' # Optional log format customization
see more about log format syntax.
Using Guzzle in controllers:
$client = $this->get('guzzle.client'); $response = $client->get('http://example.com');
Using Guzzle in your own services:
application.my_service: class: App\Service\MyService arguments: - "@guzzle.client"
or you can just use autowire feature with GuzzleHttp\ClientInterface type hint.
Features
Symfony Debug Profiler
Symfony Debug Timeline
Symfony Debug Toolbar
Symfony Debug Logs (Monolog Integration)
Suggestions
Adding aliases: If you want to use different names for provided services you can use aliases. This is a good idea if you don't want have any dependency to guzzle in your service name.
services: http.client: alias: guzzle.client
Creating multiple clients: If you want to have different Guzzle clients in your application all you need is to define them in services file and add "guzzle.client" tag to turn on Symfony integration (Debug toolbar, logs, so on..).
services: guzzle.client_one: class: GuzzleHttp\Client tags: - { name: guzzle.client } guzzle.client_two: class: GuzzleHttp\Client tags: - { name: guzzle.client }
Authors
- Nikolay Labinskiy aka e-moe
Inspired by Chris Wilkinson's and Florian Preusner's GuzzleBundles (1, 2).
See also the list of contributors who participated in this project.
License
This bundle is released under the MIT license
e-moe/guzzle6-bundle 适用场景与选型建议
e-moe/guzzle6-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 262.41k 次下载、GitHub Stars 达 11, 最近一次更新时间为 2015 年 06 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「curl」 「http」 「rest」 「http client」 「api」 「client」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 e-moe/guzzle6-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 e-moe/guzzle6-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 e-moe/guzzle6-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
cURL and cURL based Soap-Client for PHP
repository php library
Simple cURL wrapper
A PSR-7 compatible library for making CRUD API endpoints
Api bundle
A fluent PHP CURL wrapper
统计信息
- 总下载量: 262.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 25
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-06-14



