From ef0050d517d2e5e3c2fd5484d627f9a5a14372cd Mon Sep 17 00:00:00 2001 From: Jonathan Maron Date: Thu, 10 Nov 2011 09:50:03 +0100 Subject: [PATCH] Simplified check environment script --- .../Service/LiveDocx/check-environment.php | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/demos/Zend/Service/LiveDocx/check-environment.php b/demos/Zend/Service/LiveDocx/check-environment.php index 848ad3789de..afe83315f15 100755 --- a/demos/Zend/Service/LiveDocx/check-environment.php +++ b/demos/Zend/Service/LiveDocx/check-environment.php @@ -5,7 +5,6 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'Bootstrap.php'; use Zend\Version; -use Zend\Http\Client as HttpClient; use Zend\Service\LiveDocx\MailMerge; use Zend\Service\LiveDocx\Helper; @@ -21,16 +20,6 @@ // ----------------------------------------------------------------------------- -$httpClientOptions = array( - 'maxredirects' => 3, - 'timeout' => 5, // seconds - 'keepalive' => false -); - -$httpClient = new HttpClient(null, $httpClientOptions); - -// ----------------------------------------------------------------------------- - $failed = false; $counter = 1; @@ -194,20 +183,16 @@ // ----------------------------------------------------------------------------- -$httpClient->setUri(GEOIP_SERVICE_URI); - -$httpResponse = $httpClient->request(); - -if ($httpResponse->isSuccessful()) { +$results = @file_get_contents(GEOIP_SERVICE_URI); +if (false != $results) { $keys = array( 'Ip' => 'IP address', 'City' => 'city', 'RegionName' => 'region', 'CountryName' => 'country' ); - - $simplexml = new SimpleXMLElement($httpResponse->getBody()); + $simplexml = new SimpleXMLElement($results); foreach ($keys as $key => $value) { Helper::printLineToc($counter, sprintf('Checking your %s (%s)', $keys[$key], $simplexml->$key), TEST_PASS); $counter++; @@ -221,9 +206,9 @@ $microtime = microtime(true); -$httpClient->setUri(MailMerge::WSDL); +$results = @file_get_contents(MailMerge::WSDL); -if ($httpClient->request()->isSuccessful()) { +if (false != $results) { $duration = microtime(true) - $microtime; $result = TEST_PASS; } else { @@ -286,9 +271,9 @@ $microtime = microtime(true); - $httpClient->setUri(DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_WSDL); + $results = @file_get_contents(DEMOS_ZEND_SERVICE_LIVEDOCX_PREMIUM_WSDL); - if ($httpClient->request()->isSuccessful()) { + if (false != $results) { $duration = microtime(true) - $microtime; $result = TEST_PASS; } else {