Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
class Response
{
protected $transferInfo;
protected $aaa;
protected $bbb;
protected $ccc;
protected $ddd;
protected $eee;
public function __construct($transferInfo)
{
$this->transferInfo = $transferInfo;
}
}
class Client
{
protected $lastResponse;
public function doRequest()
{
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'elasticsearch:9200',
CURLINFO_HEADER_OUT => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => '',
]);
curl_exec($ch);
$response = new Response(curl_getinfo($ch));
$this->lastResponse = $response;
}
}
$client = new Client();
$client->doRequest();
$client->doRequest();
$client->doRequest();
$client->doRequest();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment