定制 serato/sws-discovery 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

serato/sws-discovery

最新稳定版本:v3.0.0

Composer 安装命令:

composer require serato/sws-discovery

包简介

A PHP library for obtaining information about Serato web services.

README 文档

README

A PHP library for aiding in the discovery of Serato web applications and services.

Installation

To include this library in a PHP project add the following line to the project's composer.json file in the require section:

{
  "require": {
    "serato/sws-discovery": "^1.0.0"
  }
}

See Packagist for a list of all available versions.

Host Names

Serato\ServiceDiscovery\HostName provides a means of discovery per-environment host names for all Serato websites and applications.

Basic usage

use Serato\ServiceDiscovery\HostName;

# Create an instance providing and environment name and number
$hostNames = new HostName('production', 1);

# Use the `HostName::get` method to return the host name for a named application
echo $hostNames->get(HostName::IDENTITY);

# Use the `HostName::getAll` method to return an array of all hosts
print_r($hostNames->getAll());

HostName::getSwsHosts method

The Serato\ServiceDiscovery\HostName::getSwsHosts method provides a convenient way to fetch an array of host names for all SWS web services.

The keys of the array are as follows:

  • 'profile'
  • 'da'
  • 'notifications'
  • 'id'
  • 'license'
  • 'ecom'
  • 'rewards'
  • 'video'
  • 'ai-proxy'
  • 'cloudlib'

Using Docker to develop this library.

Use the provided docker-compose.yml file to develop this library.

# Run the `php-build` service using the default PHP version (7.1) and remove the container after use.
docker-compose run --rm  php-build

# Provide an alternative PHP version via the PHP_VERSION environment variable.
PHP_VERSION=7.2 docker-compose run --rm  php-build

When Docker Compose runs the container it executes docker.sh.

This script installs some required packages, installs Composer and performs a composer install for this PHP library.

It then opens a bash shell for interacting with the running container.

AWS credentials for integration tests

To run integration tests that interact with AWS services provide an IAM access key and secret via the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.

AWS_ACCESS_KEY_ID=my_key_id AWS_SECRET_ACCESS_KEY=my_key_secret docker-compose run --rm  php-build

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 8
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-09-21