doppiogancio/guzzle-bundle-base-path-plugin
最新稳定版本:v1.0.0
Composer 安装命令:
composer require doppiogancio/guzzle-bundle-base-path-plugin
包简介
A Plugin for Guzzle Bundle, that will help you setting a base path to each request of your client.
README 文档
README
A Plugin for Guzzle Bundle, that will help you to set a base path to each request of your client.
Prerequisites
- PHP 7.1 or above
Installation
To install this bundle, run the command below on the command line and you will get the latest stable version from [Packagist][4].
composer require doppiogancio/guzzle-bundle-base-path
Usage
Enable bundle
Find next lines in src/Kernel.php:
foreach ($contents as $class => $envs) { if (isset($envs['all']) || isset($envs[$this->environment])) { yield new $class(); } }
and replace them by:
foreach ($contents as $class => $envs) { if (isset($envs['all']) || isset($envs[$this->environment])) { if ($class === \EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle::class) { yield new $class([ new Doppiogancio\Bundle\GuzzleBundleBasePathPlugin\GuzzleBundleBasePathPlugin(), ]); } else { yield new $class(); } } }
Basic configuration
# app/config/config.yml eight_points_guzzle: clients: api_payment: base_url: "http://api.domain.tld" options: auth: oauth2 # plugin settings plugin: base_path: base_path: "/api/v3"
Options
| Key | Description | Required | Example |
|---|---|---|---|
| base_path | base path to add to every request path | yes | /api/v3 |
License
This middleware is licensed under the MIT License - see the LICENSE file for details
统计信息
- 总下载量: 124
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-01