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

Commit

Permalink
Merge branch 'feature/deprecations' into release-2.0
Browse files Browse the repository at this point in the history
Forward port #303

Conflicts:
	CHANGELOG.md
	src/Response/EmitterInterface.php
	src/Response/SapiEmitter.php
	src/Response/SapiEmitterTrait.php
	src/Response/SapiStreamEmitter.php
	src/Server.php
  • Loading branch information
weierophinney committed May 29, 2018
2 parents 6d0510e + 8781b74 commit 8dfaf21
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ All notable changes to this project will be documented in this file, in reverse

### Deprecated

- Nothing.
- [#303](https://github.com/zendframework/zend-diactoros/pull/303) deprecates `Zend\Diactoros\Response\EmitterInterface` and its various implementations. These are now provided via the
[zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner) package as 1:1 substitutions.

- [#303](https://github.com/zendframework/zend-diactoros/pull/303) deprecates the `Zend\Diactoros\Server` class. Users are directed to the `RequestHandlerRunner` class from the
[zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner) package as an alternative.

### Removed

Expand Down
7 changes: 7 additions & 0 deletions doc/book/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ In most cases, you will only use the methods defined in the `UploadedFileInterfa

## Server

> ### Deprecated
>
> The class `Zend\Diactoros\Server` is deprecated as of the 1.8.0 release. We
> recommend using the class `Zend\HttpHandlerRunner\RequestHandlerRunner` via
> the package [zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner)
> instead.
`Zend\Diactoros\Server` represents a server capable of executing a callback. It has four methods:

```php
Expand Down
7 changes: 7 additions & 0 deletions doc/book/emitting-responses.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Emitting responses

> ## 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
> [zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner).
> We suggest using that functionality instead.
If you are using a non-SAPI PHP implementation and wish to use the `Server` class, or if you do not
want to use the `Server` implementation but want to emit a response, this package provides an
interface, `Zend\Diactoros\Response\EmitterInterface`, defining a method `emit()` for emitting the
Expand Down
5 changes: 2 additions & 3 deletions doc/book/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ well as a "server" implementation similar to [node's http.Server](http://nodejs.

This package exists:

- to provide a proof-of-concept of the accepted PSR HTTP message interfaces with relation to
server-side applications.
- to provide a node-like paradigm for PHP front controllers.
- to provide an implementation of [PSR-7 HTTP message interfaces](https://www.php-fig.org/psr/psr-7)
- with relation to server-side applications.
- to provide a common methodology for marshaling a request from the server environment.
7 changes: 7 additions & 0 deletions doc/book/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ $response = $response

### "Serving" an application

> ### Deprecated
>
> The class `Zend\Diactoros\Server` is deprecated as of the 1.8.0 release. We
> recommend using the class `Zend\HttpHandlerRunner\RequestHandlerRunner` via
> the package [zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner)
> instead.
`Zend\Diactoros\Server` mimics a portion of the API of node's `http.Server` class. It invokes a
callback, passing it an `ServerRequest`, an `Response`, and optionally a callback to use for
incomplete/unhandled requests.
Expand Down

0 comments on commit 8dfaf21

Please sign in to comment.