8000 Merge pull request #58 from php-http/doc-stubs · php-http/documentation@33c4aab · GitHub
[go: up one dir, main page]

Skip to content

Commit 33c4aab

Browse files
committed
Merge pull request #58 from php-http/doc-stubs
Add complete TOC and stubs
2 parents 5946c4b + 6904910 commit 33c4aab

28 files changed

+110
-22
lines changed

docs/clients/curl-client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# CURL Client

docs/clients/guzzle5-adapter.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Guzzle5 Adapter

docs/clients/guzzle6-adapter.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Guzzle6 Adapter

docs/clients/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Clients & Adapters
2+
3+
There are clients implementing one of the HTTPlug interfaces directly,
4+
and adapter packages that implement the interface and forward the calls to HTTP clients not implementing the interface.
5+
6+
TODO

docs/clients/mock-client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Mock Client

docs/clients/react-adapter.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# React Adapter

docs/clients/socket-client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Socket Client
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Adapter Integration Tests
2+
3+
TODO

docs/httplug/utils.md renamed to docs/components/client-common.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Utilities
1+
# Client Common
22

3-
The utilities package provides some useful tools for working with HTTPlug. Include them in your project with composer:
3+
The client-common package provides some useful tools for working with HTTPlug.
4+
Include them in your project with composer:
45

56
``` bash
67
composer require "php-http/utils" "^1.0"

docs/components/authentication.md renamed to docs/components/message.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
# Authentication
1+
# Message
2+
3+
This package contains various PSR-7 tools which might be useful in an HTTP workflow:
4+
5+
* Authentication method implementations
6+
* Various Stream encoding tools
7+
* Message decorators
8+
* Message factory implementations for Guzzle PSR-7 and Diactoros
9+
* Cookie implementation
10+
11+
## Authentication
212

313
The Authentication component allows you to to implement authentication methods which can simply update the request
414
with authentication detail (for example by adding an `Authorization` header).
515
This is useful when you have to send multiple requests to the same endpoint. Using an authentication implementation,
616
these details can be separated from the actual requests.
717

818

9-
## Installation
19+
### Installation
1020

1121
```
1222
$ composer require php-http/message
1323
```
1424

1525

16-
## Authentication methods
26+
### Authentication methods
1727

1828
Method | Parameters | Behavior
1929
---------------- | ------------------------------------------------- | --------
@@ -28,15 +38,15 @@ Matching | An authentication instance and a matcher callback | Behavior
2838
[2]: http://www.xml.com/pub/a/2003/12/17/dive.html
2939

3040

31-
## Integration with HTTPlug
41+
### Integration with HTTPlug
3242

3343
Normally requests must be authenticated "by hand" which is not really convenient.
3444

3545
If you use HTTPlug, you can integrate this component into the client using the
3646
[authentication plugin](/httplug/plugins/authentication).
3747

3848

39-
## Examples
49+
### Examples
4050

4151
General usage looks like the following:
4252

@@ -48,7 +58,7 @@ $authentication->authenticate($request);
4858< 10000 /code>
```
4959

5060

51-
### Basic Auth
61+
#### Basic Auth
5262

5363
``` php
5464
use Http\Message\Authentication\BasicAuth;
@@ -57,7 +67,7 @@ $authentication = new BasicAuth('username', 'password');
5767
```
5868

5969

60-
### Bearer
70+
#### Bearer
6171

6272
``` php
6373
use Http\Message\Authentication\Bearer;
@@ -66,7 +76,7 @@ $authentication = new Bearer('token');
6676
```
6777

6878

69-
### WSSE
79+
#### WSSE
7080

7181
``` php
7282
use Http\Message\Authentication\Wsse;
@@ -75,7 +85,7 @@ $authentication = new Wsse('username', 'password');
7585
```
7686

7787

78-
### Query Params
88+
#### Query Params
7989

8090
`http://api.example.com/endpoint?access_token=9zh987g86fg87gh978hg9g79`
8191

@@ -94,7 +104,7 @@ $authentication = new QueryParams([
94104

95105

96106

97-
### Chain
107+
#### Chain
98108

99109
The idea behind this authentication method is that in some cases you might need to
100110
authenticate the request with multiple methods.
@@ -115,7 +125,7 @@ $authentication = new Chain($authenticationChain);
115125
```
116126

117127

118-
### Matching
128+
#### Matching
119129

120130
With this authentication method you can conditionally add authentication details to your request by passing a callable
121131
to it. When a request is passed, the callable is called and used as a boolean value in order to decide whether
@@ -152,7 +162,7 @@ $authentication = Matching::createUrlMatcher(new AuthenticationMethod(), '\/api'
152162
```
153163

154164

155-
## Implement your own
165+
### Implement your own
156166

157167
Implementing an authentication method is easy: only one method needs to be implemented.
158168

docs/components/promise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Promise
2+
3+
Promise used for asynchronous HTTP requests.
4+
5+
This will eventually be removed/deprecated and replaced with the upcoming Promise PSR.

docs/httplug/migrating.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The monolithic ivory package has been separated into several smaller, more speci
1111
Instead of `Ivory\HttpAdapter\PsrHttpAdapter`, use `Http\Client\HttpClient`.
1212
The HttpClient simply has a method to send requests.
1313

14-
If you used the `Ivory\HttpAdapter\HttpAdapter`, have a look at the [Utilities](utils.md)
14+
If you used the `Ivory\HttpAdapter\HttpAdapter`, have a look at [client-common](../components/client-common.md)
1515
and use the `Http\Client\Utils\HttpMethodsClient` which wraps any HttpClient and provides the convenience methods
1616
to send requests without creating RequestInterface instances.
1717

@@ -22,9 +22,9 @@ Replace usage of `GuzzleHttp\ClientInterface` with `Http\Client\HttpClient`.
2222
The `send` method is called `sendRequest`.
2323
Instead of the `$options` argument, configure the client appropriately during set up.
2424
If you need different settings, create different instances of the client.
25-
You can use [plugins](plugins.md) to further tune your client.
25+
You can use [plugins](../plugins/index.md) to further tune your client.
2626

27-
If you used the `request` method, have a look at the [Utilities](utils.md) and
27+
If you used the `request` method, have a look at [client-common](../components/client-common.md) and
2828
use the `Http\Client\Utils\HttpMethodsClient` which wraps any HttpClient and provides the convenience methods
2929
to send requests without creating RequestInterface instances.
3030

docs/httplug/plugins/encoding.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/httplug/plugins/authentication.md renamed to docs/plugins/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ $pluginClient = new PluginClient(
1919
);
2020
```
2121

22-
Check the [authentication component documentation](http://docs.httplug.io/en/latest/components/authentication/)
22+
Check the [authentication component documentation](../components/message.md#authentication)
2323
for the list of available authentication methods.

docs/plugins/cache.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Cache Plugin
2+
3+
TODO

docs/plugins/content-length.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Content-Length Plugin
2+
3+
TODO
File renamed without changes.

docs/plugins/decoder.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Decoder Plugin
2+
3+
TODO
File renamed without changes.

docs/plugins/history.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# History Plugin
2+
3+
TODO: explain the error plugin

docs/httplug/plugins.md renamed to docs/plugins/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,5 @@ the core as small as possible with the most widely used plugin implementations.
180180

181181
Even if we think that a plugin is not suitable for the core, we want to help you sharing your work with the community.
182182
You can always open a Pull Request to place a link and a small description of your plugin on the
183-
[Third Party Plugins](plugins/third-party-plugins.md) page. In special cases,
183+
[Third Party Plugins](third-party-plugins.md) page. In special cases,
184184
we might offer you to host your package under the PHP HTTP namespace.

docs/plugins/journal.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Journal
2+
3+
TODO

docs/plugins/logger.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Logger Plugin
2+
3+
TODO
File renamed without changes.
File renamed without changes.
File renamed without changes.

mkdocs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,45 @@ markdown_extensions:
99
permalink: true
1010
- sane_lists
1111
- admonition
12+
13+
pages:
14+
- Home: index.md
15+
- HTTPlug:
16+
- httplug/index.md
17+
- httplug/migrating.md
18+
- httplug/tutorial.md
19+
- httplug/virtual-package.md
20+
- Components:
21+
- 'Clients & Adapters':
22+
- Introduction: clients/index.md
23+
- clients/curl-client.md
24+
- clients/mock-client.md
25+
- clients/socket-client.md
26+
- clients/guzzle5-adapter.md
27+
- clients/guzzle6-adapter.md
28+
- clients/react-adapter.md
29+
- Plugins:
30+
- plugins/index.md
31+
- plugins/authentication.md
32+
- plugins/cach A8EB e.md
33+
- plugins/content-length.md
34+
- plugins/cookie.md
35+
- plugins/decoder.md
36+
- plugins/error.md
37+
- plugins/history.md
38+
- plugins/journal.md
39+
- plugins/logger.md
40+
- plugins/redirect.md
41+
- plugins/retry.md
42+
- plugins/stopwatch.md
43+
- plugins/third-party-plugins.md
44+
- components/message.md
45+
- Other Components:
46+
- components/client-common.md
47+
- components/discovery.md
48+
- components/message-factory.md
49+
- components/promise.md
50+
- Development:
51+
- development/code-of-conduct.md
52+
- development/contributing.md
53+
- development/license.md

0 commit comments

Comments
 (0)
0