@@ -17,6 +17,7 @@ It currently ships with the following Diagnostic Checks:
17
17
* [ DiskFree] ( #diskfree ) - check there's enough free space on given path,
18
18
* [ ExtensionLoaded] ( #extensionloaded ) - make sure extension is loaded,
19
19
* [ HttpService] ( #httpservice ) - check if given http host is responding,
20
+ * [ GuzzleHttpService] ( #guzzlehttpservice ) - check if given http host is responding using Guzzle,
20
21
* [ Memcache] ( #memcache ) - check if memcache extension is loaded and given server is reachable,
21
22
* [ PhpVersion] ( #phpversion ) - make sure that PHP version matches constraint,
22
23
* [ PhpFlag] ( #phpflag ) - make sure that given PHP flag (feature) is turned on or off.
@@ -418,6 +419,35 @@ $checkPageContent = new HttpService(
418
419
);
419
420
````
420
421
422
+ ### GuzzleHttpService
423
+
424
+ Attempt connection to given HTTP host or IP address and try to load a web page using
425
+ [ Guzzle] ( http://guzzle3.readthedocs.org/en/latest/ ) . The check also supports checking response
426
+ codes and page contents.
427
+
428
+ ```` php
429
+ <?php
430
+ use ZendDiagnostics\Check\GuzzleHttpService;
431
+
432
+ // Try to connect to google.com
433
+ $checkGoogle = new GuzzleHttpService('www.google.com');
434
+
435
+ // Check port 8080 on localhost
436
+ $checkLocal = new GuzzleHttpService('127.0.0.1:8080');
437
+
438
+ // Check that the page exists (response code must equal 200)
439
+ $checkPage = new GuzzleHttpService('www.example.com/some/page.html');
440
+
441
+ // Check page content
442
+ $checkPageContent = new GuzzleHttpService(
443
+ 'www.example.com/some/page.html',
444
+ array(),
445
+ array(),
446
+ 200,
447
+ '<title >Hello World</title >'
448
+ );
449
+ ````
450
+
421
451
### Memcache
422
452
423
453
Attempt to connect to given Memcache server.
0 commit comments