Created
June 14, 2015 13:57
-
-
Save im-denisenko/7ad6c84353c2acc807bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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