pcextreme/rgw-admin-client
最新稳定版本:0.1
Composer 安装命令:
composer require pcextreme/rgw-admin-client
包简介
PHP client for the rados gateway admin operations api.
README 文档
README
Rados Gateway API Client
PHP client for the Rados Gateway admin operations api.
Requirements
- PHP 5.6
- PHP 7.0
- PHP 7.1
Installation
What type of installation should I choose?
It's very simple, choose for an express installation if your application already contains a HTTP library such as GuzzleHTTP, otherwise just perform an quick installation.
Quick installation
For an quick installation we recommend you to install the php-http/curl-client package. This package is
a small abstraction around native php curl api.
$ composer require php-http/curl-client guzzlehttp/psr7
After that you are ready to install this package:
$ composer require pcextreme/rgw-admin-client
Express installation
If your application already contains a compatible HTTP client, just install the correct HTTP client adapter before using this package. For a list of compatible adapters click here.
For example if your application depends on guzzlehttp/guzzle version 6 you need to install the guzzle 6 adapter package.
$ composer require php-http/guzzle6-adapter
After the installation of a client adapter you are ready to install this package:
$ composer require pcextreme/rgw-admin-client
Usage
Client configuration
Before you can use the api client you need to provided the apiUrl, apiKey and secretKey. You need to provided
them when creating an instance of the client class.
$client = new Client([ 'apiUrl' => 'https://', 'apiKey' => '', 'secretKey' => '', ]);
Create and execute a request
There are two ways to interact with the rados api via this package, you can manually create the request and send them afterwards. See the code below for an example.
$request = $client->createRequest('user', 'get', ['uid' => 'user-id']); $response = $client->sendRequest($request); var_dump($response);
You can also use the preferred short syntax.
$response = $client->get('user', ['uid' => 'user-id']); var_dump($response);
See the api docs for more information about the available api resources.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 27.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-12
