Skip to content

Commit 00012ab

Browse files
committed
Deprecate plugins and plugin client
Provide cross-compatibility between new and old plugins The deprecated PluginClient now wraps the new one internally and dispatches the requests to it. Full BC should be preserved, relevant exceptions caught and rethrown with the appropriate wrapping. Add deprecation error triggering
1 parent 9395b4f commit 00012ab

26 files changed

+119
-117
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change Log
22

3+
4+
## Unreleased
5+
6+
### Deprecated
7+
8+
- Core plugins and plugin client, moved to [client-common](https://github.com/php-http/client-common)
9+
- Logger plugin, moved to [logger-plugin](https://github.com/php-http/logger-plugin)
10+
- Cache plugin, moved to [cache-plugin](https://github.com/php-http/cache-plugin)
11+
- Stopwatch plugin, moved to [stopwatch-plugin](https://github.com/php-http/stopwatch-plugin)
12+
13+
314
## 1.0.1 - 2016-01-29
415

516
### Changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"php": ">=5.4",
1515
"php-http/httplug": "^1.0",
1616
"php-http/message-factory": "^1.0.2",
17-
"php-http/client-common": "^1.0",
17+
"php-http/client-common": "^1.1",
1818
"php-http/message": "^1.0",
1919
"symfony/options-resolver": "^2.6|^3.0"
2020
},

src/AddHostPlugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Http\Client\Plugin;
44

5+
@trigger_error('The '.__NAMESPACE__.'\AddHostPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\AddHostPlugin instead.', E_USER_DEPRECATED);
6+
57
use Psr\Http\Message\RequestInterface;
68
use Psr\Http\Message\UriInterface;
79
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -10,6 +12,8 @@
1012
* Add schema and host to a request. Can be set to overwrite the schema and host if desired.
1113
*
1214
* @author Tobias Nyholm <[email protected]>
15+
*
16+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\AddHostPlugin} instead.
1317
*/
1418
class AddHostPlugin implements Plugin
1519
{

src/AuthenticationPlugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
namespace Http\Client\Plugin;
44

5+
@trigger_error('The '.__NAMESPACE__.'\AuthenticationPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\AuthenticationPlugin instead.', E_USER_DEPRECATED);
6+
57
use Http\Message\Authentication;
68
use Psr\Http\Message\RequestInterface;
79

810
/**
911
* Send an authenticated request.
1012
*
1113
* @author Joel Wurtz <[email protected]>
14+
*
15+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\AuthenticationPlugin} instead.
1216
*/
1317
class AuthenticationPlugin implements Plugin
1418
{

src/CachePlugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Http\Client\Plugin;
44

5+
@trigger_error('The '.__NAMESPACE__.'\CachePlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\CachePlugin instead.', E_USER_DEPRECATED);
6+
57
use Http\Message\StreamFactory;
68
use Http\Promise\FulfilledPromise;
79
use Psr\Cache\CacheItemPoolInterface;
@@ -13,6 +15,8 @@
1315
* Allow for caching a response.
1416
*
1517
* @author Tobias Nyholm <[email protected]>
18+
*
19+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\CachePlugin} instead.
1620
*/
1721
class CachePlugin implements Plugin
1822
{

src/ContentLengthPlugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
namespace Http\Client\Plugin;
44

5+
@trigger_error('The '.__NAMESPACE__.'\ContentLengthPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\ContentLengthPlugin instead.', E_USER_DEPRECATED);
6+
57
use Http\Message\Encoding\ChunkStream;
68
use Psr\Http\Message\RequestInterface;
79

810
/**
911
* Allow to set the correct content length header on the request or to transfer it as a chunk if not possible.
1012
*
1113
* @author Joel Wurtz <[email protected]>
14+
*
15+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\ContentLengthPlugin} instead.
1216
*/
1317
class ContentLengthPlugin implements Plugin
1418
{

src/CookiePlugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Http\Client\Plugin;
44

5+
@trigger_error('The '.__NAMESPACE__.'\CookiePlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\CookiePlugin instead.', E_USER_DEPRECATED);
6+
57
use Http\Client\Exception\TransferException;
68
use Http\Message\Cookie;
79
use Http\Message\CookieJar;
@@ -12,6 +14,8 @@
1214
* Handle request cookies.
1315
*
1416
* @author Joel Wurtz <[email protected]>
17+
*
18+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\CookiePlugin} instead.
1519
*/
1620
class CookiePlugin implements Plugin
1721
{

src/DecoderPlugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Http\Client\Plugin;
44

5+
@trigger_error('The '.__NAMESPACE__.'\DecoderPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\DecoderPlugin instead.', E_USER_DEPRECATED);
6+
57
use Http\Message\Encoding\DechunkStream;
68
use Http\Message\Encoding\DecompressStream;
79
use Http\Message\Encoding\GzipDecodeStream;
@@ -19,6 +21,8 @@
1921
* If Content-Encoding is not disabled, the plugin will add an Accept-Encoding header for the encoding methods it supports.
2022
*
2123
* @author Joel Wurtz <[email protected]>
24+
*
25+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\DecoderPlugin} instead.
2226
*/
2327
class DecoderPlugin implements Plugin
2428
{

src/ErrorPlugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Http\Client\Plugin;
44

5+
@trigger_error('The '.__NAMESPACE__.'\ErrorPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\ErrorPlugin instead.', E_USER_DEPRECATED);
6+
57
use Http\Client\Plugin\Exception\ClientErrorException;
68
use Http\Client\Plugin\Exception\ServerErrorException;
79
use Psr\Http\Message\RequestInterface;
@@ -13,6 +15,8 @@
1315
* By default an exception will be thrown for all status codes from 400 to 599.
1416
*
1517
* @author Joel Wurtz <[email protected]>
18+
*
19+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\ErrorPlugin} instead.
1620
*/
1721
class ErrorPlugin implements Plugin
1822
{

src/Exception/CircularRedirectionException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
namespace Http\Client\Plugin\Exception;
44

5+
@trigger_error('The '.__NAMESPACE__.'\CircularRedirectionException class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Exception\CircularRedirectionException instead.', E_USER_DEPRECATED);
6+
57
use Http\Client\Exception\HttpException;
68

79
/**
810
* Thrown when circular redirection is detected.
911
*
1012
* @author Joel Wurtz <[email protected]>
13+
*
14+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\CircularRedirectionException} instead.
1115
*/
1216
class CircularRedirectionException extends HttpException
1317
{

0 commit comments

Comments
 (0)