proemergotech/correlate-php-core
Composer 安装命令:
composer require proemergotech/correlate-php-core
包简介
Core interface package for correlate id generation for microservices writen in PHP.
README 文档
README
Overview
It's very difficult to track a request accross the system when we are working with microservices. We came out a solution for that. We generate a unique version 4 uuid for every request and every service passes this id via request header to other services. We call this correlation ID.
Packages
- proemergotech/correlate-php-laravel
- Middleware for Laravel and Lumen frameworks.
- proemergotech/correlate-php-psr-7
- Middleware for any PSR-7 compatible frameworks like Slim Framework.
- proemergotech/correlate-php-monolog
- Monolog processor for correlate middlewares (you don't have to use this directly).
- proemergotech/correlate-php-guzzle
- Guzzle middleware to add correlation id to every requests.
- proemergotech/correlate-php-core
- Common package for correlate id middlewares to provide consistent header naming accross projects.
Installation
You should not use this directly.
By the way if you want to use it directly, you can install it via composer.
$ composer require proemergotech/correlate-php-core
Defaults
Default header name is X-Correlation-ID and default parameter name is x_correlation_id.
Usage
Generate a correlation id:
\ProEmergotech\Correlate\Correlate\Correlate::id();
Other methods:
\ProEmergotech\Correlate\Correlate::getHeaderName(); \ProEmergotech\Correlate\Correlate::getParamName(); \ProEmergotech\Correlate\Correlate::getGeneratorFunc(); // You can override defaults... \ProEmergotech\Correlate\Correlate::setHeaderName('X-My-Correlation-ID'); \ProEmergotech\Correlate\Correlate::setParamName('my_correlation_id'); \ProEmergotech\Correlate\Correlate::setGeneratorFunc(function(){ return uniqid(); });
Contributing
See CONTRIBUTING.md file.
Credits
This package developed by Soma Szélpál at Pro Emergotech Ltd..
License
This project is released under the MIT License.
统计信息
- 总下载量: 7.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-15