1. Go to this page and download the library: Download redirectionio/proxy-sdk 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/ */
redirectionio / proxy-sdk example snippets
$client = new RedirectionIO\Client\Sdk\Client($projectKey, $connections);
$request = new RedirectionIO\Client\Sdk\HttpMessage\Request(
$_SERVER['HTTP_HOST'],
$_SERVER['REQUEST_URI'],
$_SERVER['HTTP_USER_AGENT'],
$_SERVER['HTTP_REFERER']
);
$response = $client->request(new RedirectionIO\Client\Sdk\Command\MatchWithResponseCommand($request));
// There are no redirection for this Request
if (null === $response) {
$response = '...'; // Handle your request with your application
}
$client->request(new RedirectionIO\Client\Sdk\Command\LogCommand($request, $response));
// Finally, Returns your response
use RedirectionIO\Client\Sdk\Client;
$client = new Client(string $projectKey, array $connections, int $timeout = 10000, bool $debug = false, LoggerInterface $logger = null);
use RedirectionIO\Client\Sdk\Client;
use RedirectionIO\Client\Sdk\HttpMessage\Request;
use RedirectionIO\Client\Sdk\Command\MatchCommand;
$client->request(new MatchWithResponseCommand(Request $request);
use RedirectionIO\Client\Sdk\Client;
use RedirectionIO\Client\Sdk\HttpMessage\Request;
use RedirectionIO\Client\Sdk\Command\MatchCommand;
$client->request(new MatchCommand(Request $request);
use RedirectionIO\Client\Sdk\Client;
use RedirectionIO\Client\Sdk\Command\LogCommand;
use RedirectionIO\Client\Sdk\HttpMessage\Response;
use RedirectionIO\Client\Sdk\HttpMessage\Request;
$client->request(new LogCommand(Request $request, Response $response));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.