承接 miquido/request-data-collector-guzzle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

miquido/request-data-collector-guzzle

Composer 安装命令:

composer require miquido/request-data-collector-guzzle

包简介

Library used to extend the Request Data Collector by collecting Guzzle requests.

README 文档

README

This package is an extension to the Request Data Collector. Allows collecting Guzzle requests.

GitHub license Build

Set up

GuzzleCollector

This collector is being used to collect data about performed Guzzle requests.

'guzzle' => [
	'driver' => \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::class,

	'decorate' => [
		'with' => \Miquido\RequestDataCollector\Collectors\GuzzleCollector\Guzzle6ClientDecorator::class,

		'abstracts' => [
			abstract => [
				'type'    => \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::TYPE_*,
				'create'  => boolean,
				'collect' => [
					\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_BY,
					\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_VIA,
					\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_METHOD,
					\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_URI,
					\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_HEADERS,
					\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_OPTIONS,
				],
			],
			
			// ...
		],
	],
],

decorate.with

Defines Guzzle Client decorator class responsible for collecting requests.

decorate.abstracts

Defines a list of Guzzle Clients registered in the container. All abstracts will be decorated with class defined in decorate.with.

Every abstract is being defined in following way:

abstract => [
	'type'   => \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::TYPE_*,
	'create' => boolean,
	'collect' => [
		// \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_*
	],
],

abstract is the name under which instance has been registered in the container (e.g. my-guzzle-client or \GuzzleHttp\ClientInterface::class).

type defines the type of abstract (see \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::TYPE_* constants).

collect defines list of request's information that should be logged (see \Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_* constants). If missing, all information will be used. The times information will always be available.

Additionally, You can include and exclude headers (case-insensitive). Remember, that inclusions have priority over exclusions.

abstract => [
	// ...

	'collect' => [
		\Miquido\RequestDataCollector\Collectors\GuzzleCollector\GuzzleCollector::INFO_HEADERS => [
			// We don't want Authorization header to be present in logs
			'excludes' => [
				'Authorization'
			],

			// From all headers that has been sent, only those are interesting for us
			'includes' => [
				'Accept',
				'content-type',
			],
		],
	],
],

When create equals true, defines to add an instance to the container even if it does not exist.

About

The project was made by Miquido: https://www.miquido.com

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2019-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固