定制 myena/php-rgw-api 二次开发

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

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

myena/php-rgw-api

最新稳定版本:4.0.0

Composer 安装命令:

composer require myena/php-rgw-api

包简介

PHP Client for the Rados Gateway API that doesn't suck

README 文档

README

This lib aims to be a comprehensive PHP SDK for the Rados Gateway Admin API.

Installation

This lib is designed to be installed using Composer

{
  "require": {
    "myena/php-rgw-api": "4.*"
  }
}

Features

  1. All object-containing responses are modeled (list)
  2. Entire request chain is fully modeled, with required parameters being type-hinted (e.g. UserRootLink::Info)
  3. All models have full swagger-php markup
  4. Includes undocumented /metadata endpoints
  5. Parameter validation (link) with hopefully useful error messages

Usage Basics

More details on each component can be found below, however here is a quick fill-in-the-blank example:

$config = new \MyENA\RGW\Config([
    'address'   => '',
    'adminPath' => '',
    'apiKey'    => '',
    'apiSecret' => '',
]);
$client = new \MyENA\RGW\Client($config, new \MyENA\RGW\Signature\V2Signature());

[$users, $err] = $client->Metadata()->User()->List()->execute();
if (null !== $err) {
    die((string)$err);
}
var_dump($users);

// and whatever else you wanna do...

Advanced Config

You must first construct a Config:

$config = new \MyENA\RGW\Config([
    'address'   => '',  // REQUIRED
    'apiKey'    => '',  // REQUIRED
    'apiSecret' => '',  // REQUIRED

    'adminPath'     => '',  // optional, whatever your admin ops path is

    'silent' => false // optional, silences all logging
]);

Custom Guzzle Client

The optional 2nd argument in the Config constructor accepts any object implementing the Guzzle ClientInterface. If left null, a new Guzzle Client with no options will be constructed.

Custom Logger

The optional 3rd argument in the Config constructor accepts any object implementing the Psr LoggerInterface. If left null, a new Psr NullLogger will be constructed.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 5
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MPL-2.0
  • 更新时间: 2018-06-14