Skip to content

Commit

Permalink
update composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ouqiang committed Jun 19, 2017
1 parent a71ffb7 commit 62228ff
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ Requirements
Installation
------------
```shell
git clone https://github.com/ouqiang/etcd-php
cd etcd-php
composer install
composer require start-point/etcd-php
```

Usage
Expand Down Expand Up @@ -75,6 +73,12 @@ $client->authDisable();
// get auth token
$client->authenticate('user', 'password');

// set auth token
$client->setToken($token);

// clear auth token
$client->clearToken();

// add a new role
$client->addRole('root');

Expand Down
20 changes: 16 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
{
"name": "start-point/etcd-php",
"type": "library",
"description": "PHP client for Etcd v3",
"keywords": ["etcdv3", "etcd", "etcd-client", "etcd-php"],
"homepage": "https://github.com/ouqiang/etcd-php",
"license": "MIT",
"authors": [
{
"name": "ouqiang",
"email": "[email protected]",
"homepage": "https://github.com/ouqiang"
}
],
"require": {
"php": ">= 5.5"
"php": ">= 5.5",
"guzzlehttp/guzzle": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "4.5.*",
"guzzlehttp/guzzle": "~6.0"
"phpunit/phpunit": "4.5.*"
},

"autoload": {
"psr-4": {
"Etcd\\": "src/"
Expand Down
18 changes: 9 additions & 9 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Client
protected $httpClient;

/**
* @var bool 友好输出, 只返回所需字段
* @var bool 友好输出, 只返回所需字段
*/
protected $pretty = false;

Expand Down Expand Up @@ -116,7 +116,7 @@ public function clearToken()
*
* @param string $key
* @param string $value
* @param array $options 可选参数
* @param array $options 可选参数
* int64 lease
* bool prev_kv
* bool ignore_value
Expand Down Expand Up @@ -641,19 +641,19 @@ public function revokeUserRole($user, $role)
// endregion auth

/**
* 发送HTTP请求
* 发送HTTP请求
*
* @param string $uri
* @param array $params 请求参数
* @param array $options 可选参数
* @param array $params 请求参数
* @param array $options 可选参数
* @return array|BadResponseException
*/
protected function request($uri, array $params = [], array $options = [])
{
if ($options) {
$params = array_merge($params, $options);
}
// 没有参数, 设置一个默认参数
// 没有参数, 设置一个默认参数
if (!$params) {
$params['php-etcd-client'] = 1;
}
Expand All @@ -676,7 +676,7 @@ protected function request($uri, array $params = [], array $options = [])
}

/**
* string类型key用base64编码
* string类型key用base64编码
*
* @param array $data
* @return array
Expand All @@ -694,11 +694,11 @@ protected function encode(array $data)
}

/**
* 指定字段base64解码
* 指定字段base64解码
*
* @param array $body
* @param string $bodyKey
* @param array $fields 需要解码的字段
* @param array $fields 需要解码的字段
* @return array
*/
protected function decodeBodyForFields(array $body, $bodyKey, array $fields)
Expand Down

0 comments on commit 62228ff

Please sign in to comment.