Skip to content

Commit

Permalink
Merge pull request #315 from glaubinix/cache-psr17
Browse files Browse the repository at this point in the history
Cache-Plugin: update for usage with PSR-17 StreamFactory in 2.0
  • Loading branch information
dbu authored Nov 15, 2023
2 parents 9423a3c + e2cccfa commit b1f61a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Usage
The ``CachePlugin`` allows you to cache responses from the server. It can use
any PSR-6 compatible caching engine. By default, the plugin respects the cache
control headers from the server as specified in :rfc:`7234`. It needs a
:ref:`stream <stream-factory>` and a `PSR-6`_ implementation::
`PSR-17`_ StreamFactoryInterface and a `PSR-6`_ implementation::

use Http\Discovery\HttpClientDiscovery;
use Http\Client\Common\PluginClient;
use Http\Client\Common\Plugin\CachePlugin;

/** @var \Psr\Cache\CacheItemPoolInterface $pool */
$pool = ...
/** @var \Http\Message\StreamFactory $streamFactory */
/** @var \Psr\Http\Message\StreamFactoryInterface $streamFactory */
$streamFactory = ...

$options = [];
Expand Down Expand Up @@ -180,3 +180,4 @@ It does store responses with cookies or a ``Set-Cookie`` header. Be careful with
the order of your plugins.

.. _PSR-6: http://www.php-fig.org/psr/psr-6/
.. _PSR-17: http://www.php-fig.org/psr/psr-17/

0 comments on commit b1f61a3

Please sign in to comment.