Skip to content

Instantly share code, notes, and snippets.

@saxenap
Last active September 7, 2015 17:01
Show Gist options
  • Save saxenap/1089c562a32b98eb97e9 to your computer and use it in GitHub Desktop.
Save saxenap/1089c562a32b98eb97e9 to your computer and use it in GitHub Desktop.
class CurlRequest implements MakesRequest
{
private $result;
public function execute($requestUrl)
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $requestUrl,
));
$this->result = curl_exec($curl);
curl_close($curl);
}
public function getResult()
{
return $this->result;
}
}
interface MakesRequest
{
public function execute($requestUrl);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment