Skip to content

Move plugins #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log


## Unreleased

### Deprecated

- Core plugins and plugin client, moved to [client-common](https://github.com/php-http/client-common)
- Logger plugin, moved to [logger-plugin](https://github.com/php-http/logger-plugin)
- Cache plugin, moved to [cache-plugin](https://github.com/php-http/cache-plugin)
- Stopwatch plugin, moved to [stopwatch-plugin](https://github.com/php-http/stopwatch-plugin)


## 1.0.1 - 2016-01-29

### Changed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"php": ">=5.4",
"php-http/httplug": "^1.0",
"php-http/message-factory": "^1.0.2",
"php-http/client-common": "^1.0",
"php-http/client-common": "^1.1",
"php-http/message": "^1.0",
"symfony/options-resolver": "^2.6|^3.0"
},
Expand Down
4 changes: 4 additions & 0 deletions src/AddHostPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Http\Client\Plugin;

@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);

use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\UriInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
Expand All @@ -10,6 +12,8 @@
* Add schema and host to a request. Can be set to overwrite the schema and host if desired.
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\AddHostPlugin} instead.
*/
class AddHostPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/AuthenticationPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

namespace Http\Client\Plugin;

@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);

use Http\Message\Authentication;
use Psr\Http\Message\RequestInterface;

/**
* Send an authenticated request.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\AuthenticationPlugin} instead.
*/
class AuthenticationPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/CachePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Http\Client\Plugin;

@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);

use Http\Message\StreamFactory;
use Http\Promise\FulfilledPromise;
use Psr\Cache\CacheItemPoolInterface;
Expand All @@ -13,6 +15,8 @@
* Allow for caching a response.
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\CachePlugin} instead.
*/
class CachePlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/ContentLengthPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

namespace Http\Client\Plugin;

@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);

use Http\Message\Encoding\ChunkStream;
use Psr\Http\Message\RequestInterface;

/**
* Allow to set the correct content length header on the request or to transfer it as a chunk if not possible.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\ContentLengthPlugin} instead.
*/
class ContentLengthPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/CookiePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Http\Client\Plugin;

@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);

use Http\Client\Exception\TransferException;
use Http\Message\Cookie;
use Http\Message\CookieJar;
Expand All @@ -12,6 +14,8 @@
* Handle request cookies.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\CookiePlugin} instead.
*/
class CookiePlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/DecoderPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Http\Client\Plugin;

@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);

use Http\Message\Encoding\DechunkStream;
use Http\Message\Encoding\DecompressStream;
use Http\Message\Encoding\GzipDecodeStream;
Expand All @@ -19,6 +21,8 @@
* If Content-Encoding is not disabled, the plugin will add an Accept-Encoding header for the encoding methods it supports.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\DecoderPlugin} instead.
*/
class DecoderPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/ErrorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Http\Client\Plugin;

@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);

use Http\Client\Plugin\Exception\ClientErrorException;
use Http\Client\Plugin\Exception\ServerErrorException;
use Psr\Http\Message\RequestInterface;
Expand All @@ -13,6 +15,8 @@
* By default an exception will be thrown for all status codes from 400 to 599.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\ErrorPlugin} instead.
*/
class ErrorPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/Exception/CircularRedirectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

namespace Http\Client\Plugin\Exception;

@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);

use Http\Client\Exception\HttpException;

/**
* Thrown when circular redirection is detected.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\CircularRedirectionException} instead.
*/
class CircularRedirectionException extends HttpException
{
Expand Down
4 changes: 4 additions & 0 deletions src/Exception/ClientErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

namespace Http\Client\Plugin\Exception;

@trigger_error('The '.__NAMESPACE__.'\ClientErrorException class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Exception\ClientErrorException instead.', E_USER_DEPRECATED);

use Http\Client\Exception\HttpException;

/**
* Thrown when there is a client error (4xx).
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\ClientErrorException} instead.
*/
class ClientErrorException extends HttpException
{
Expand Down
4 changes: 4 additions & 0 deletions src/Exception/LoopException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

namespace Http\Client\Plugin\Exception;

@trigger_error('The '.__NAMESPACE__.'\LoopException class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Exception\LoopException instead.', E_USER_DEPRECATED);

use Http\Client\Exception\RequestException;

/**
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\LoopException} instead.
*/
class LoopException extends RequestException
{
Expand Down
4 changes: 4 additions & 0 deletions src/Exception/MultipleRedirectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

namespace Http\Client\Plugin\Exception;

@trigger_error('The '.__NAMESPACE__.'\MultipleRedirectionException class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Exception\MultipleRedirectionException instead.', E_USER_DEPRECATED);

use Http\Client\Exception\HttpException;

/**
* Redirect location cannot be chosen.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\MultipleRedirectionException} instead.
*/
class MultipleRedirectionException extends HttpException
{
Expand Down
4 changes: 4 additions & 0 deletions src/Exception/ServerErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

namespace Http\Client\Plugin\Exception;

@trigger_error('The '.__NAMESPACE__.'\ServerErrorException class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Exception\ServerErrorException instead.', E_USER_DEPRECATED);

use Http\Client\Exception\HttpException;

/**
* Thrown when there is a server error (5xx).
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\ServerErrorException} instead.
*/
class ServerErrorException extends HttpException
{
Expand Down
4 changes: 4 additions & 0 deletions src/HeaderAppendPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Http\Client\Plugin;

@trigger_error('The '.__NAMESPACE__.'\HeaderAppendPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\HeaderAppendPlugin instead.', E_USER_DEPRECATED);

use Psr\Http\Message\RequestInterface;

/**
Expand All @@ -13,6 +15,8 @@
* @link https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
*
* @author Soufiane Ghzal <sghzal@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HeaderAppendPlugin} instead.
*/
class HeaderAppendPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/HeaderDefaultsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

namespace Http\Client\Plugin;

@trigger_error('The '.__NAMESPACE__.'\HeaderDefaultsPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\HeaderDefaultsPlugin instead.', E_USER_DEPRECATED);

use Psr\Http\Message\RequestInterface;

/**
* Set default values for the request headers.
* If a given header already exists the value wont be replaced and the request wont be changed.
*
* @author Soufiane Ghzal <sghzal@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HeaderDefaultsPlugin} instead.
*/
class HeaderDefaultsPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/HeaderRemovePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

namespace Http\Client\Plugin;

@trigger_error('The '.__NAMESPACE__.'\HeaderRemovePlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\HeaderRemovePlugin instead.', E_USER_DEPRECATED);

use Psr\Http\Message\RequestInterface;

/**
* Removes headers from the request.
*
* @author Soufiane Ghzal <sghzal@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HeaderRemovePlugin} instead.
*/
class HeaderRemovePlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/HeaderSetPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

namespace Http\Client\Plugin;

@trigger_error('The '.__NAMESPACE__.'\HeaderSetPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\HeaderSetPlugin instead.', E_USER_DEPRECATED);

use Psr\Http\Message\RequestInterface;

/**
* Set headers to the request.
* If the header does not exist it wil be set, if the header already exists it will be replaced.
*
* @author Soufiane Ghzal <sghzal@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HeaderSetPlugin} instead.
*/
class HeaderSetPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/HistoryPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

namespace Http\Client\Plugin;

@trigger_error('The '.__NAMESPACE__.'\HistoryPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\HistoryPlugin instead.', E_USER_DEPRECATED);

use Http\Client\Exception;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

/**
* Record http call.
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HistoryPlugin} instead.
*/
class HistoryPlugin implements Plugin
{
Expand Down
4 changes: 4 additions & 0 deletions src/Journal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Http\Client\Plugin;

@trigger_error('The '.__NAMESPACE__.'\Journal class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\Journal instead.', E_USER_DEPRECATED);

use Http\Client\Exception;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
Expand All @@ -10,6 +12,8 @@
* Records history of http calls.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\Journal} instead.
*/
interface Journal
{
Expand Down
4 changes: 4 additions & 0 deletions src/LoggerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Http\Client\Plugin;

@trigger_error('The '.__NAMESPACE__.'\LoggerPlugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin\LoggerPlugin instead.', E_USER_DEPRECATED);

use Http\Client\Exception;
use Http\Message\Formatter;
use Http\Message\Formatter\SimpleFormatter;
Expand All @@ -13,6 +15,8 @@
* Log request, response and exception for a HTTP Client.
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\LoggerPlugin} instead.
*/
class LoggerPlugin implements Plugin
{
Expand Down
17 changes: 4 additions & 13 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace Http\Client\Plugin;

use Http\Promise\Promise;
use Psr\Http\Message\RequestInterface;
@trigger_error('The '.__NAMESPACE__.'\Plugin class is deprecated since version 1.1 and will be removed in 2.0. Use Http\Client\Common\Plugin instead.', E_USER_DEPRECATED);

/**
* A plugin is a middleware to transform the request and/or the response.
Expand All @@ -14,17 +13,9 @@
* - restart the request
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin} instead.
*/
interface Plugin
interface Plugin extends \Http\Client\Common\Plugin
{
/**
* Handle the request and return the response coming from the next callable.
*
* @param RequestInterface $request
* @param callable $next Next middleware in the chain, the request is passed as the first argument
* @param callable $first First middleware in the chain, used to to restart a request
*
* @return Promise
*/
public function handleRequest(RequestInterface $request, callable $next, callable $first);
}
Loading