Created
July 1, 2013 09:38
-
-
Save RadekDvorak/5899580 to your computer and use it in GitHub Desktop.
Git bisect script for guzzle #366
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 | |
require __DIR__ . "/vendor/autoload.php"; | |
class ImageDownloaderExample | |
{ | |
private function downloadImage() | |
{ | |
$client = new \Guzzle\Service\Client(); | |
$request = $client->get("http://www.google.com/images/srpr/logo4w.png"); | |
$response = $request->send(); | |
$body = $response->getBody(); | |
$stream = $body->getStream(); | |
return $stream; | |
} | |
public function testStream() | |
{ | |
$guzzleStream = $this->downloadImage(); | |
return gettype($guzzleStream); | |
} | |
} | |
$downloader = new ImageDownloaderExample(); | |
$type = $downloader->testStream(); | |
if ($type === "unknown type") | |
{ | |
exit(1); | |
} | |
else | |
{ | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment