Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 11535d5

Browse files
committed
updated readme
1 parent 4be96cd commit 11535d5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ It currently ships with the following Diagnostic Checks:
1717
* [DiskFree](#diskfree) - check there's enough free space on given path,
1818
* [ExtensionLoaded](#extensionloaded) - make sure extension is loaded,
1919
* [HttpService](#httpservice) - check if given http host is responding,
20+
* [GuzzleHttpService](#guzzlehttpservice) - check if given http host is responding using Guzzle,
2021
* [Memcache](#memcache) - check if memcache extension is loaded and given server is reachable,
2122
* [PhpVersion](#phpversion) - make sure that PHP version matches constraint,
2223
* [PhpFlag](#phpflag) - make sure that given PHP flag (feature) is turned on or off.
@@ -418,6 +419,35 @@ $checkPageContent = new HttpService(
418419
);
419420
````
420421

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+
421451
### Memcache
422452

423453
Attempt to connect to given Memcache server.

0 commit comments

Comments
 (0)