From fd083fca794cef4abe20cabaae6c473456055362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Sat, 2 Nov 2019 15:46:21 +0100 Subject: [PATCH 1/9] Fixes first headline in blockquotes --- docs/book/v1/emitting-responses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/v1/emitting-responses.md b/docs/book/v1/emitting-responses.md index b682fa4e..c808284a 100644 --- a/docs/book/v1/emitting-responses.md +++ b/docs/book/v1/emitting-responses.md @@ -1,6 +1,6 @@ # 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 From b2b731d78c7f4c90fe0c1418cec8878d016c63a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Sat, 2 Nov 2019 15:46:30 +0100 Subject: [PATCH 2/9] Removes unneeded index.html --- docs/book/index.html | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 docs/book/index.html diff --git a/docs/book/index.html b/docs/book/index.html deleted file mode 100644 index 35edad9b..00000000 --- a/docs/book/index.html +++ /dev/null @@ -1,10 +0,0 @@ -
-
-

zend-diactoros

- -

PSR-7 HTTP message implementation.

- -
$ composer require zendframework/zend-diactoros
-
-
- From 69cba0fc09b4554a0fbea49065a29eaeb5b553ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Sat, 2 Nov 2019 15:47:41 +0100 Subject: [PATCH 3/9] Updates headline to use capital letters for nouns --- docs/book/v1/api.md | 2 +- docs/book/v1/custom-responses.md | 2 +- docs/book/v1/emitting-responses.md | 4 ++-- docs/book/v1/serialization.md | 2 +- docs/book/v1/usage.md | 6 +++--- docs/book/v2/api.md | 2 +- docs/book/v2/custom-responses.md | 2 +- docs/book/v2/migration.md | 2 +- docs/book/v2/serialization.md | 2 +- docs/book/v2/usage.md | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/book/v1/api.md b/docs/book/v1/api.md index 8705ee8c..58ef4962 100644 --- a/docs/book/v1/api.md +++ b/docs/book/v1/api.md @@ -128,7 +128,7 @@ $request = RequestFactory::fromGlobals( ); ``` -### ServerRequestFactory helper functions +### ServerRequestFactory Helper Functions - Since 1.8.0 diff --git a/docs/book/v1/custom-responses.md b/docs/book/v1/custom-responses.md index d1f4bb19..b5c5f2c3 100644 --- a/docs/book/v1/custom-responses.md +++ b/docs/book/v1/custom-responses.md @@ -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. diff --git a/docs/book/v1/emitting-responses.md b/docs/book/v1/emitting-responses.md index c808284a..d3c4df16 100644 --- a/docs/book/v1/emitting-responses.md +++ b/docs/book/v1/emitting-responses.md @@ -1,4 +1,4 @@ -# Emitting responses +# Emitting Responses > ### Deprecated > @@ -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 diff --git a/docs/book/v1/serialization.md b/docs/book/v1/serialization.md index ba22c377..aa3b5576 100644 --- a/docs/book/v1/serialization.md +++ b/docs/book/v1/serialization.md @@ -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: diff --git a/docs/book/v1/usage.md b/docs/book/v1/usage.md index 80406c2d..aea1d72f 100644 --- a/docs/book/v1/usage.md +++ b/docs/book/v1/usage.md @@ -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 @@ -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 @@ -116,7 +116,7 @@ $response = $response ->withAddedHeader('X-Show-Something', 'something'); ``` -### "Serving" an application +### "Serving" an Application > ### Deprecated > diff --git a/docs/book/v2/api.md b/docs/book/v2/api.md index d4ff1886..a37cfb46 100644 --- a/docs/book/v2/api.md +++ b/docs/book/v2/api.md @@ -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` diff --git a/docs/book/v2/custom-responses.md b/docs/book/v2/custom-responses.md index 0fd7d08f..38bf4ef3 100644 --- a/docs/book/v2/custom-responses.md +++ b/docs/book/v2/custom-responses.md @@ -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. diff --git a/docs/book/v2/migration.md b/docs/book/v2/migration.md index 1852510f..4f0040dd 100644 --- a/docs/book/v2/migration.md +++ b/docs/book/v2/migration.md @@ -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 diff --git a/docs/book/v2/serialization.md b/docs/book/v2/serialization.md index ba22c377..aa3b5576 100644 --- a/docs/book/v2/serialization.md +++ b/docs/book/v2/serialization.md @@ -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: diff --git a/docs/book/v2/usage.md b/docs/book/v2/usage.md index d0f38258..3ee41f12 100644 --- a/docs/book/v2/usage.md +++ b/docs/book/v2/usage.md @@ -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 @@ -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 From b2167d29d9394b8d2023086dfd8569366f1e6a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Sat, 2 Nov 2019 15:48:19 +0100 Subject: [PATCH 4/9] Updates headlines for consistency with navigation --- docs/book/v1/install.md | 2 +- docs/book/v1/overview.md | 2 +- docs/book/v2/factories.md | 2 +- docs/book/v2/install.md | 2 +- docs/book/v2/overview.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/book/v1/install.md b/docs/book/v1/install.md index c9033fd6..0dac69ec 100644 --- a/docs/book/v1/install.md +++ b/docs/book/v1/install.md @@ -1,4 +1,4 @@ -# Installation and Requirements +# Installation Install this library using composer: diff --git a/docs/book/v1/overview.md b/docs/book/v1/overview.md index 16dbf99b..bb7f8fe4 100644 --- a/docs/book/v1/overview.md +++ b/docs/book/v1/overview.md @@ -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 diff --git a/docs/book/v2/factories.md b/docs/book/v2/factories.md index 87fa7eaa..6cc19e70 100644 --- a/docs/book/v2/factories.md +++ b/docs/book/v2/factories.md @@ -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 diff --git a/docs/book/v2/install.md b/docs/book/v2/install.md index 0c4a0ec3..d05b3202 100644 --- a/docs/book/v2/install.md +++ b/docs/book/v2/install.md @@ -1,4 +1,4 @@ -# Installation and Requirements +# Installation Install this library using composer: diff --git a/docs/book/v2/overview.md b/docs/book/v2/overview.md index de8d5715..2969f567 100644 --- a/docs/book/v2/overview.md +++ b/docs/book/v2/overview.md @@ -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/), From e0d5f5801bc75b1f2665f2e4a39f547ba7bfaf75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Sat, 2 Nov 2019 15:48:53 +0100 Subject: [PATCH 5/9] Updates navigation in MkDocs configuration --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index a063c0c6..200fc0ef 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,7 +5,7 @@ extra: versions: - v2 - v1 -pages: +nav: - Home: index.md - v2: - Overview: v2/overview.md From 126d4db36c7876b2916657c6e05473cd0ad4e4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Sat, 2 Nov 2019 15:49:30 +0100 Subject: [PATCH 6/9] Updates migration page --- docs/book/v2/migration.md | 2 +- mkdocs.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/book/v2/migration.md b/docs/book/v2/migration.md index 4f0040dd..ef1439d0 100644 --- a/docs/book/v2/migration.md +++ b/docs/book/v2/migration.md @@ -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 diff --git a/mkdocs.yml b/mkdocs.yml index 200fc0ef..ad26995e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,7 +16,8 @@ nav: - "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 From 7057b904ff2f25c31e92c18dce7ed043f692f993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Sat, 2 Nov 2019 15:49:59 +0100 Subject: [PATCH 7/9] Updates version hints --- docs/book/v1/api.md | 4 ++-- docs/book/v1/custom-responses.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/book/v1/api.md b/docs/book/v1/api.md index 58ef4962..c016ae90 100644 --- a/docs/book/v1/api.md +++ b/docs/book/v1/api.md @@ -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: @@ -130,7 +130,7 @@ $request = RequestFactory::fromGlobals( ### 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` diff --git a/docs/book/v1/custom-responses.md b/docs/book/v1/custom-responses.md index b5c5f2c3..06eda06e 100644 --- a/docs/book/v1/custom-responses.md +++ b/docs/book/v1/custom-responses.md @@ -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: From 8fcc34bd2e81fd22a91472c957ca49fbe6cc0cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Sat, 2 Nov 2019 15:52:09 +0100 Subject: [PATCH 8/9] Removes unneeded blockquote --- docs/book/v1/emitting-responses.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/book/v1/emitting-responses.md b/docs/book/v1/emitting-responses.md index d3c4df16..c32b68e7 100644 --- a/docs/book/v1/emitting-responses.md +++ b/docs/book/v1/emitting-responses.md @@ -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. From 2058373a4936fba9253bb1eb69f5383f857db081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Sun, 3 Nov 2019 08:57:05 +0000 Subject: [PATCH 9/9] Use double quotations for consitency --- mkdocs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index ad26995e..a06e923f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,7 +17,7 @@ nav: - Serialization: v2/serialization.md - API: v2/api.md - Migration: - - 'Migration to Version 2': v2/migration.md + - "Migration to Version 2": v2/migration.md - v1: - Overview: v1/overview.md - Installation: v1/install.md @@ -36,5 +36,5 @@ nav: - "_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"