1. Go to this page and download the library: Download jasny/dummy-middleware library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jasny / dummy-middleware example snippets
use Jasny\Dummy\ServerMiddleware;
use Zend\Stratigility\MiddlewarePipe;
use Zend\Diactoros\ResponseFactory;
$middleware = new ServerMiddleware();
$app = new MiddlewarePipe();
$app->pipe($middleware);
use Relay\RelayBuilder;
use Jasny\Dummy\ClientMiddleware;
$middleware = new ClientMiddleware();
$relayBuilder = new RelayBuilder($resolver);
$relay = $relayBuilder->newInstance([
$middleware->asDoublePass(),
]);
$response = $relay($request, $baseResponse);
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Client;
use Jasny\Dummy\ClientMiddleware;
$middleware = new ClientMiddleware();
$stack = new HandlerStack();
$stack->push($middleware->forGuzzle());
$client = new Client(['handler' => $stack]);
use Http\Discovery\HttpClientDiscovery;
use Http\Client\Common\PluginClient;
use Jasny\Dummy\ClientMiddleware;
$middleware = new ClientMiddleware();
$pluginClient = new PluginClient(
HttpClientDiscovery::find(),
[
$middleware->forHttplug(),
]
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.