Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'docs/375'
Browse files Browse the repository at this point in the history
Close #375
  • Loading branch information
michalbundyra committed Nov 3, 2019
2 parents b59d466 + 2058373 commit 6e1e657
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 40 deletions.
10 changes: 0 additions & 10 deletions docs/book/index.html

This file was deleted.

6 changes: 3 additions & 3 deletions docs/book/v1/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Like the `Request` and `ServerRequest`, responses are immutable. Any methods tha

### HtmlResponse and JsonResponse

- Added in 1.1.0
> Available since version 1.1.0
The most common use case in server-side applications for generating responses is to provide a string
to use for the response, typically HTML or data to serialize as JSON. `Zend\Diactoros\Response\HtmlResponse` and `Zend\Diactoros\Response\JsonResponse` exist to facilitate these use cases:
Expand Down Expand Up @@ -128,9 +128,9 @@ $request = RequestFactory::fromGlobals(
);
```

### ServerRequestFactory helper functions
### ServerRequestFactory Helper Functions

- Since 1.8.0
> Available since version 1.8.0
In order to create the various artifacts required by a `ServerRequest` instance,
Diactoros also provides a number of functions under the `Zend\Diactoros`
Expand Down
4 changes: 2 additions & 2 deletions docs/book/v1/custom-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Headers must be in the same format as you would provide to the

## XML Responses

- Since 1.7.0
> Available since version 1.7.0
`Zend\Diactoros\Response\XmlResponse` allows specifying XML as a payload, and sets the
`Content-Type` header to `application/xml` by default:
Expand Down Expand Up @@ -180,7 +180,7 @@ $uri = $request->getUri();
$response = new RedirectResponse($uri->withPath('/login'));
```

## Creating custom responses
## Creating custom Responses

PHP allows constructor overloading. What this means is that constructors of extending classes can
define completely different argument sets without conflicting with the parent implementation.
Expand Down
10 changes: 5 additions & 5 deletions docs/book/v1/emitting-responses.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Emitting responses
# Emitting Responses

> ## Deprecated
> ### Deprecated
>
> Emitters are deprecated from Diactoros starting with version 1.8.0. The
> functionality is now available for any PSR-7 implementation via the package
Expand Down Expand Up @@ -29,7 +29,7 @@ $emitter = new Zend\Diactoros\Response\SapiEmitter();
$emitter->emit($response);
```

## Emitting ranges of streamed files
## Emitting Ranges of streamed Files

The `SapiStreamEmitter` is useful when you want to emit a `Content-Range`. As an
example, to stream a range of bytes from a file to a client, the client can pass
Expand All @@ -53,8 +53,8 @@ $response = new Response($body);
$response = $response->withHeader('Content-Range', $range);
```

> Note: you will likely want to ensure the range specified falls within the
> content size of the streamed body!
(Note: you will likely want to ensure the range specified falls within the
content size of the streamed body!)

The `SapiStreamEmitter` detects the `Content-Range` header and emits only the
bytes specified.
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v1/install.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Installation and Requirements
# Installation

Install this library using composer:

Expand Down
2 changes: 1 addition & 1 deletion docs/book/v1/overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# zend-diactoros: HTTP Messages
# Overview

`zend-diactoros` is a PHP package containing implementations of the [accepted PSR-7 HTTP message
interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md), as
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v1/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ the following static methods:
The deserialization methods (`fromArray()`) will raise exceptions if errors occur while parsing the
message.

### Example usage
### Example Usage

Array serialization can be usesful for log messages:

Expand Down
6 changes: 3 additions & 3 deletions docs/book/v1/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ illustration of a possible implementation.)
Server-side applications will need to marshal the incoming request based on superglobals, and will
then populate and send a response.

### Marshaling an incoming request
### Marshaling an incoming Request

PHP contains a plethora of information about the incoming request, and keeps that information in a
variety of locations. `Zend\Diactoros\ServerRequestFactory::fromGlobals()` can simplify marshaling
Expand Down Expand Up @@ -94,7 +94,7 @@ in the name were renamed with underlines. By getting the cookies directly from t
access to the original cookies in the way you set them in your application and they are send by the user
agent.

### Manipulating the response
### Manipulating the Response

Use the response object to add headers and provide content for the response. Writing to the body
does not create a state change in the response, so it can be done without capturing the return
Expand All @@ -116,7 +116,7 @@ $response = $response
->withAddedHeader('X-Show-Something', 'something');
```

### "Serving" an application
### "Serving" an Application

> ### Deprecated
>
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v2/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ $request = RequestFactory::fromGlobals(
);
```

### ServerRequestFactory helper functions
### ServerRequestFactory Helper Functions

In order to create the various artifacts required by a `ServerRequest` instance,
Diactoros also provides a number of functions under the `Zend\Diactoros`
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v2/custom-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ $uri = $request->getUri();
$response = new RedirectResponse($uri->withPath('/login'));
```

## Creating custom responses
## Creating custom Responses

PHP allows constructor overloading. What this means is that constructors of extending classes can
define completely different argument sets without conflicting with the parent implementation.
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v2/factories.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HTTP Message Factories
# Factories

[PSR-17](https://www.php-fig.org/psr/psr-17/) defines factory interfaces for
creating [PSR-7](https://www.php-fig.org/psr/psr-7/) instances. As of version
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v2/install.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Installation and Requirements
# Installation

Install this library using composer:

Expand Down
4 changes: 2 additions & 2 deletions docs/book/v2/migration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Migration to version 2
# Migration to Version 2

If you are only using the PSR-7 implementations (e.g., `Request`, `Response`,
`ServerRequest`, etc.), migrating to v2 can be done by updating your
Expand Down Expand Up @@ -64,7 +64,7 @@ to provide these capabilities instead. Usage is similar, but the
`RequestHandlerRunner` provides better error handling, and integration with
emitters.
### ServerRequestFactory methods
### ServerRequestFactory Methods
A number of public static methods have been removed from
`ServerRequestFactory`. The following table details the methods removed, and
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v2/overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# zend-diactoros: HTTP Messages
# Overview

`zend-diactoros` is a PHP package containing implementations of the
[PSR-7 HTTP message interfaces](https://www.php-fig.org/psr/psr-7/),
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v2/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ the following static methods:
The deserialization methods (`fromArray()`) will raise exceptions if errors occur while parsing the
message.

### Example usage
### Example Usage

Array serialization can be usesful for log messages:

Expand Down
4 changes: 2 additions & 2 deletions docs/book/v2/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ illustration of a possible implementation.)
Server-side applications will need to marshal the incoming request based on superglobals, and will
then populate and send a response.

### Marshaling an incoming request
### Marshaling an incoming Request

PHP contains a plethora of information about the incoming request, and keeps that information in a
variety of locations. `Zend\Diactoros\ServerRequestFactory::fromGlobals()` can simplify marshaling
Expand Down Expand Up @@ -94,7 +94,7 @@ in the name were renamed with underlines. By getting the cookies directly from t
access to the original cookies in the way you set them in your application and they are send by the user
agent.

### Manipulating the response
### Manipulating the Response

Use the response object to add headers and provide content for the response. Writing to the body
does not create a state change in the response, so it can be done without capturing the return
Expand Down
9 changes: 5 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extra:
versions:
- v2
- v1
pages:
nav:
- Home: index.md
- v2:
- Overview: v2/overview.md
Expand All @@ -16,7 +16,8 @@ pages:
- "Custom Responses": v2/custom-responses.md
- Serialization: v2/serialization.md
- API: v2/api.md
- Migration: v2/migration.md
- Migration:
- "Migration to Version 2": v2/migration.md
- v1:
- Overview: v1/overview.md
- Installation: v1/install.md
Expand All @@ -35,5 +36,5 @@ pages:
- "_reference-serialization": serialization.md
- "_reference-api": api.md
site_name: zend-diactoros
site_description: 'PSR-7 HTTP message implementations.'
repo_url: 'https://github.com/zendframework/zend-diactoros'
site_description: "PSR-7 HTTP message implementations"
repo_url: "https://github.com/zendframework/zend-diactoros"

0 comments on commit 6e1e657

Please sign in to comment.