…packed with features!
• The power of cURL w/ a simple interface!
• Can send requests serially or in parallel!
• Provides event hooks & plugins for mocks,
cookies, caching, logging, OAuth, etc.!
• Keep-Alive & connection pooling!
• And more…!
…popular!
• Nearly 3400+ stars on GitHub!
• Used in many other projects including!
– Drupal 8!
– Goutte!
– AWS SDK for PHP!
– Laravel Mail Component!
– Tumblr!
– Many more J!
Slide 17
Slide 17 text
…a well-crafted PHP library!
• Follow good OOP patterns and practices!
• Follows PSR-1, 2, 3, & 4!
• Uses Git, Composer, Travis CI, PHPUnit!
• High test coverage!
• Extensible via DI and the event system!
Slide 18
Slide 18 text
"Web Service Client in PHP"!
To the tune of Journey's!
"Separate Ways"!
♫!
Slide 19
Slide 19 text
Here we stand!
Nodes apart!
Code factored in two!
♫!
Slide 20
Slide 20 text
APIs!
Using Guzzle!
Talkin' to you!
♫!
Slide 21
Slide 21 text
Send me your data!
I'll stream it all!
I'll send you my parameters!
With your protocol!
Answer my call!
♫!
Slide 22
Slide 22 text
Guzzle sends my request!
To use cURL, Guzzle's the best!
HTTP and REST!
Web service client in PHP!
♫!
Slide 23
Slide 23 text
If you're sending a header!
Guzzle does it better!
Follows the spec to the letter!
Web service client in PHP!
♫!
Slide 24
Slide 24 text
We still love you cURL!
We still need you cURL!
♫!
Slide 25
Slide 25 text
But when cURL tries to hurt you!
Guzzle won't desert you!
♫!
Slide 26
Slide 26 text
Nooooo!!
♫!
Slide 27
Slide 27 text
4!
Guzzle!
What's New?!
Slide 28
Slide 28 text
What's New in Guzzle 4?!
• Improved performance!
• Simpler interfaces!
• Smaller core library!
• Event system is improved!
• Requires PHP 5.4!
• Custom service descriptions!
• Actually follows SemVer now!
Slide 29
Slide 29 text
Swappable HTTP Adapters!
• Curl\MultiAdapter
cURL is enabled!
• Curl\CurlAdapter
PHP 5.5+ required (cURL "easy " handles)!
• StreamingAdapter
no cURL, allow_url_fopen is enabled!
• StreamingProxyAdapter
cURL & allow_url_fopen are enabled!
Slide 30
Slide 30 text
Parallel Requests are Better!
Asynchronous handling!
$client-‐>sendAll($requests,
[
'complete'
=>
function(CompleteEvent
$e)
{
//
Do
something
},
'error'
=>
function(ErrorEvent
$e)
{
//
Do
something
}
]);
Slide 31
Slide 31 text
Parallel Requests are Better!
V3!
V4!
Slide 32
Slide 32 text
Parallel Requests are Better!
Rolling Queues
V3!
V4!
Slide 33
Slide 33 text
Guzzle Resources – V3 vs. V4!
V3
V4
Namespace
Guzzle! GuzzleHttp!
GitHub
guzzle/guzzle3! guzzle/guzzle!
Package
guzzle/guzzle! guzzlehttp/guzzle!
Docs
guzzle3.readthedocs.org! guzzlephp.org!
This
allows
you
to
use
Guzzle
3
and
4
in
the
same
project.
Guzzle Service Descriptions!
• DSL for describing web service operations!
• Defines where parameters go!
(e.g., uri, query string, post field, json body)!
• Defines how response data is represented!
• Similar to Swagger!
• Guzzle 4's service descriptions are still beta!
Twilio Client Implementation!
Let's take a look at!
the source code. J!
http://ow.ly/x7ugf!
!
Slide 49
Slide 49 text
Summary!
Guzzle is an awesome HTTP client!
— & —!
A web service client framework!
!
Check out version 4 of Guzzle!
!
Writing a web service client can be easy!
Slide 50
Slide 50 text
Building Web Service Clients!
Guzzle!
By: @jeremeamia!
Feedback: https://joind.in/10638!
Guzzle: http://guzzlephp.org!
Questions?!
with!