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

Commit 26efe24

Browse files
committed
Merge branch 'feature/deprecations' into develop
Close #303
2 parents 047987b + 8781b74 commit 26efe24

File tree

10 files changed

+53
-12
lines changed

10 files changed

+53
-12
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ All notable changes to this project will be documented in this file, in reverse
1414

1515
### Deprecated
1616

17-
- Nothing.
17+
- [#303](https://github.com/zendframework/zend-diactoros/pull/303) deprecates `Zend\Diactoros\Response\EmitterInterface` and its various implementations. These are now provided via the
18+
[zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner) package as 1:1 substitutions.
19+
20+
- [#303](https://github.com/zendframework/zend-diactoros/pull/303) deprecates the `Zend\Diactoros\Server` class. Users are directed to the `RequestHandlerRunner` class from the
21+
[zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner) package as an alternative.
1822

1923
### Removed
2024

doc/book/api.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ In most cases, you will only use the methods defined in the `UploadedFileInterfa
177177

178178
## Server
179179

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

182189
```php

doc/book/emitting-responses.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Emitting responses
22

3+
> ## Deprecated
4+
>
5+
> Emitters are deprecated from Diactoros starting with version 1.8.0. The
6+
> functionality is now available for any PSR-7 implementation via the package
7+
> [zendframework/zend-httphandlerrunner](https://docs.zendframework.com/zend-httphandlerrunner).
8+
> We suggest using that functionality instead.
9+
310
If you are using a non-SAPI PHP implementation and wish to use the `Server` class, or if you do not
411
want to use the `Server` implementation but want to emit a response, this package provides an
512
interface, `Zend\Diactoros\Response\EmitterInterface`, defining a method `emit()` for emitting the

doc/book/overview.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ well as a "server" implementation similar to [node's http.Server](http://nodejs.
66

77
This package exists:
88

9-
- to provide a proof-of-concept of the accepted PSR HTTP message interfaces with relation to
10-
server-side applications.
11-
- to provide a node-like paradigm for PHP front controllers.
9+
- to provide an implementation of [PSR-7 HTTP message interfaces](https://www.php-fig.org/psr/psr-7)
10+
- with relation to server-side applications.
1211
- to provide a common methodology for marshaling a request from the server environment.

doc/book/usage.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ $response = $response
118118

119119
### "Serving" an application
120120

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

src/Response/EmitterInterface.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<?php
22
/**
3-
* Zend Framework (http://framework.zend.com/)
4-
*
5-
* @see http://github.com/zendframework/zend-diactoros for the canonical source repository
6-
* @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
3+
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4+
* @copyright Copyright (c) 2015-2018 Zend Technologies USA Inc. (https://www.zend.com)
75
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
86
*/
97

108
namespace Zend\Diactoros\Response;
119

1210
use Psr\Http\Message\ResponseInterface;
1311

12+
/**
13+
* @deprecated since 1.8.0. The package zendframework/zend-httphandlerrunner
14+
* now provides this functionality.
15+
*/
1416
interface EmitterInterface
1517
{
1618
/**

src/Response/SapiEmitter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4-
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2015-2018 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
66
*/
77

88
namespace Zend\Diactoros\Response;
99

1010
use Psr\Http\Message\ResponseInterface;
1111

12+
/**
13+
* @deprecated since 1.8.0. The package zendframework/zend-httphandlerrunner
14+
* now provides this functionality.
15+
*/
1216
class SapiEmitter implements EmitterInterface
1317
{
1418
use SapiEmitterTrait;

src/Response/SapiEmitterTrait.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4-
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2015-2018 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
66
*/
77

@@ -16,6 +16,10 @@
1616
use function str_replace;
1717
use function ucwords;
1818

19+
/**
20+
* @deprecated since 1.8.0. The package zendframework/zend-httphandlerrunner
21+
* now provides this functionality.
22+
*/
1923
trait SapiEmitterTrait
2024
{
2125
/**

src/Response/SapiStreamEmitter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4-
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2015-2018 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
66
*/
77

@@ -14,6 +14,10 @@
1414
use function strlen;
1515
use function substr;
1616

17+
/**
18+
* @deprecated since 1.8.0. The package zendframework/zend-httphandlerrunner
19+
* now provides this functionality.
20+
*/
1721
class SapiStreamEmitter implements EmitterInterface
1822
{
1923
use SapiEmitterTrait;

src/Server.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4-
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2015-2018 Zend Technologies USA Inc. (http://www.zend.com)
55
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
66
*/
77

@@ -18,6 +18,9 @@
1818
*
1919
* Given a callback, takes an incoming request, dispatches it to the
2020
* callback, and then sends a response.
21+
*
22+
* @deprecated since 1.8.0. We recommend using the `RequestHandlerRunner` class
23+
* from the zendframework/zend-httphandlerrunner package instead.
2124
*/
2225
class Server
2326
{

0 commit comments

Comments
 (0)