8000 GitHub - phpwebclient/ext-cache at v1.0.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

phpwebclient/ext-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Total Downloads License PHP

webclient/ext-cache

Cache extension for PSR-18 HTTP client.

Install

Install this package and your favorite psr-18 implementation, psr-17 implementation and psr-6 implementation.

composer require webclient/ext-cache:^1.0

Using

<?php

use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\SimpleCache\CacheInterface;
use Webclient\Extension\Cache\Client;

/** 
 * @var ClientInterface $client Your PSR-18 HTTP Client
 * @var CacheInterface $cache Your PSR-6 Simple cache
 * @var ResponseFactoryInterface $responseFactory Your PSR-17 response factory
 * @var StreamFactoryInterface $streamFactory Your PSR-17 stream factory
 */
$http = new Client($client, $cache, $responseFactory, $streamFactory, 'unique-string-for-private-caching');

/** @var RequestInterface $request */
$response = $http->sendRequest($request);

Sponsor this project

Languages

0