Slide 1

Slide 1 text

Guzzle Framework Arturo Contreras @art_k5 [email protected]

Slide 2

Slide 2 text

What is Guzzle? - PHP HTTP client framework that allows developer to consume restful services and build applications that will utilize those web services. - Created by Michael Dowling, employed at AWS web services

Slide 3

Slide 3 text

Why the need for guzzle? - Maintainable client. https://github. com/guzzle/guzzle - Relatively lightweight. - Extensibility with Symfony2 event-based plugin system. - Not only http client but service client. - Send requests in parallel. - Persistent connections. - Awesomeness.

Slide 4

Slide 4 text

How to Start - Go to guzzlephp.org - Include .phar file or use composer to load guzzle. - Start up a new http client $client = new Client('your url'); - Start consuming your web services.

Slide 5

Slide 5 text

Service Client - Commands - Service Descriptions (xml, json) - Resource Iterator

Slide 6

Slide 6 text

Plugins - Implements Symfony Event Subscriber Interface. - A bunch are included: oauth, basic auth, cookies, logging, hash validation. - Easy to build.

Slide 7

Slide 7 text

Listening to Events - Easy to latch on to requests - Listen for certain response codes - Act on those triggers and retry request - One example, CAPTCHA solving

Slide 8

Slide 8 text

Validator - Symfony 2 Validator - A number of default types are included. - Easily extendable.

Slide 9

Slide 9 text

Testing - PHPUnit - Node.js server Company's Implementation - Travis.ci - Mink/Behat

Slide 10

Slide 10 text

Questions?