Skip to content

Instantly share code, notes, and snippets.

@im-denisenko
Created June 14, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save im-denisenko/7ad6c84353c2acc807bf to your computer and use it in GitHub Desktop.
Save im-denisenko/7ad6c84353c2acc807bf to your computer and use it in GitHub Desktop.
<?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