Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jan 30, 2017
1 parent 87486fb commit 4033561
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 22 deletions.
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,25 @@ implementation that allows to access remote/web API same way as you do with norm

The preferred way to install this yii2-extension is through [composer](http://getcomposer.org/download/).

Either run
```sh
composer require "hiqdev/yii2-hiart"
```

### Performance

This package provides only **PHP streams** implementation which is clearly slower then **cURL**.
So if you have cURL extension available in your system please use `hiqdev/yii2-hiart-curl` package instead.

```sh
php composer.phar require "hiqdev/yii2-hiart"
composer require "hiqdev/yii2-hiart-curl"
```

or add
or add these lines to the require section of your composer.json:

```json
"hiqdev/yii2-hiart": "*"
"hiqdev/yii2-hiart-curl": "*"
```

to the require section of your composer.json.

## Configuration

To use this extension, configure hiart component in your application config:
Expand All @@ -52,25 +57,31 @@ Note three main options:
- `requestClass` specifies transport implementation to be used, **cURL** in this case
- `baseUri` specifies starting point of the API

### Transports

Available transports are:

- [PHP streams](http://php.net/manual/en/book.stream.php), **default**, included in this package
- [cURL](http://php.net/manual/en/book.curl.php), included in this package
- [cURL](http://php.net/manual/en/book.curl.php), provided with [yii2-hiart-curl](https://github.com/hiqdev/yii2-hiart-curl)
- [Guzzle](https://github.com/guzzle/guzzle), provided with [yii2-hiart-guzzle](https://github.com/hiqdev/yii2-hiart-guzzle)
- [yii2-httpclient](https://github.com/yiisoft/yii2-httpclient), provided with [yii2-hiart-httpclient](https://github.com/hiqdev/yii2-hiart-httpclient)

You can implement your own transport, it's not difficult see available implementations.
All you need is to create two classes:
It can be even not HTTP based.
You can implement your own transport.
All you need is to create two classes: `Request` and `Response`, it's not difficult see available implementations.
Transport can be even non-HTTP based.

### Query builders

QueryBuilder is what actually implements an API.

There are `QueryBuilder`s for:
We are developing `QueryBuilder`s for:

- Basic [REST](https://en.wikipedia.org/wiki/Representational_state_transfer), included in this package
- Basic [REST API](https://en.wikipedia.org/wiki/Representational_state_transfer), included in this package
- [GitHub API](https://developer.github.com/v3/), provided with [yii2-hiart-github](https://github.com/hiqdev/yii2-hiart-github)
- [HiPanel API](https://hipanel.com/), provided with [hipanel-hiart](https://github.com/hiqdev/hipanel-hiart)

You can implement your own API.
Basically all you need is to create your QueryBuilder with these methods:
Basically all you need is create your `QueryBuilder` class with these methods:

- `buildMethod(Query $query)`
- `buildHeaders(Query $query)`
Expand All @@ -79,7 +90,7 @@ Basically all you need is to create your QueryBuilder with these methods:
- `buildBody(Query $query)`
- `buildFormParams(Query $query)`

See available implementations and create issues on GitHub.
See available implementations and ask questions using issues on GitHub.

## Usage

Expand Down
22 changes: 14 additions & 8 deletions docs/readme/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,31 @@ Note three main options:
- `requestClass` specifies transport implementation to be used, **cURL** in this case
- `baseUri` specifies starting point of the API

### Transports

Available transports are:

- [PHP streams](http://php.net/manual/en/book.stream.php), **default**, included in this package
- [cURL](http://php.net/manual/en/book.curl.php), included in this package
- [cURL](http://php.net/manual/en/book.curl.php), provided with [yii2-hiart-curl](https://github.com/hiqdev/yii2-hiart-curl)
- [Guzzle](https://github.com/guzzle/guzzle), provided with [yii2-hiart-guzzle](https://github.com/hiqdev/yii2-hiart-guzzle)
- [yii2-httpclient](https://github.com/yiisoft/yii2-httpclient), provided with [yii2-hiart-httpclient](https://github.com/hiqdev/yii2-hiart-httpclient)

You can implement your own transport, it's not difficult see available implementations.
All you need is to create two classes:
It can be even not HTTP based.
You can implement your own transport.
All you need is to create two classes: `Request` and `Response`, it's not difficult see available implementations.
Transport can be even non-HTTP based.

### Query builders

QueryBuilder is what actually implements an API.

There are `QueryBuilder`s for:
We are developing `QueryBuilder`s for:

- Basic [REST](https://en.wikipedia.org/wiki/Representational_state_transfer), included in this package
- Basic [REST API](https://en.wikipedia.org/wiki/Representational_state_transfer), included in this package
- [GitHub API](https://developer.github.com/v3/), provided with [yii2-hiart-github](https://github.com/hiqdev/yii2-hiart-github)
- [HiPanel API](https://hipanel.com/), provided with [hipanel-hiart](https://github.com/hiqdev/hipanel-hiart)

You can implement your own API.
Basically all you need is to create your QueryBuilder with these methods:
Basically all you need is create your `QueryBuilder` class with these methods:

- `buildMethod(Query $query)`
- `buildHeaders(Query $query)`
Expand All @@ -43,4 +49,4 @@ Basically all you need is to create your QueryBuilder with these methods:
- `buildBody(Query $query)`
- `buildFormParams(Query $query)`

See available implementations and create issues on GitHub.
See available implementations and ask questions using issues on GitHub.
20 changes: 20 additions & 0 deletions docs/readme/Installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The preferred way to install this yii2-extension is through [composer](http://getcomposer.org/download/).

```sh
composer require "hiqdev/yii2-hiart"
```

### Performance

This package provides only **PHP streams** implementation which is clearly slower then **cURL**.
So if you have cURL extension available in your system please use `hiqdev/yii2-hiart-curl` package instead.

```sh
composer require "hiqdev/yii2-hiart-curl"
```

or add these lines to the require section of your composer.json:

```json
"hiqdev/yii2-hiart-curl": "*"
```

0 comments on commit 4033561

Please sign in to comment.